Introduction
Search the blog using minimum heap implementation, the link is here.
Algorithm study
Julia met a peer who is a computer science Ph.D., and she was asked to simulate the minimum heap using Array, Array.Sort. Julia followed the hint and she did write one. It works and the solution is correct. But she likes to make her simulation better. There is only 30 minutes in mocking experience, Julia could not write a real minimum heap so she chose to use an array and then sort it using O(nlogn) algorithm.
She needs to look into C# books and figure out how to do it better in short future.
One of ideas is to use C# SortedSet class. Review previous practice on Leetcode 295: Median of stream.
No comments:
Post a Comment