Saturday, August 4, 2018

Iterator for list of iterators

August 4, 2018


Introduction


It is the discussion in the mock interview with a peer who had two Google intern experience. He did very good explanation on his understanding of the algorithm called iterator for list of iterators. 

Discussion detail



We did talk about the iterator, and what is size of minimum heap? If all iterator's lists are not sorted, then the minimum heap will load all elements into heap or binary search tree.

Here is the discussion of transcript. The main idea is that all lists are sorted then it is easy to use a minimum heap with size of count of iterators. If all lists are not sorted, all elements in all lists can be put into the list first.


No comments:

Post a Comment