mergeklist

package
v0.0.0-...-d40efbb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeKSortedLists

func MergeKSortedLists(lists [][]int) []int

MergeKSortedLists merges K-sorted lists into a single list Runtime is O(K*(K*N)) = O(K^2*N) assuming each list of is length N Space is O(K) for the indicies without considering the answer list of O(K*N) size. Use this if K is very small

func MergeKSortedListsUsingHeap

func MergeKSortedListsUsingHeap(lists [][]int) []int

MergeKSortedListsUsingHeap merges K-sorted lists into a single list using a min-heap. Runtime is O(N*K log K) assuming each list of is length N Space is O(K) for the heap without considering the answer list of O(K*N) size. Use this if K is very large.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL