Created
August 4, 2018 23:18
-
-
Save jianminchen/7b82c025a381a57d9f2d6ad5b9c7be8a to your computer and use it in GitHub Desktop.
List of iterators - discussion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[1,2][3,4,5][6,7]] -> non decreasing order | |
^ ^ ^ | |
Iterator{ | |
bool HasNext() | |
T Next() | |
} | |
while(itr.hasNext()){ | |
itr.next(); | |
} | |
for(int i : list){ | |
} | |
// if lists are not sorted , put everything into a BST ... | |
// k is the number of iterators | |
// avg list is of size m | |
// km elements | |
//if lists are not sorted then heap size must be km,,, | |
If all lists are sorted, and then only put at most size of iterators into the minimum heap. Using customized comparator | |
to maintain the minimum heap. | |
//merge k sorted arrays .. | |
// leetcode slide window maximum - | |
// practice leetcode design section .. | |
//https://leetcode.com/tag/design/ | |
//https://leetcode.com/tag/backtracking |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment