![]() |
.. (לתיקייה המכילה) | |
Q1 - a | |
Note that you are required to remove the object from the heap. |
In Q1 - A. | |
No. However you can assume that n is known hence the rightmost leaf can be reached within O(logn). |
In Q1b, should the complexity be MESHUARECHET or worst case? | |
MESHUARECHET. |
In Q1c, is k a constant for complexity considerations? | |
No. |
In Q1 seif C, what do you mean by absolute value distance? | |
Let median(X) be the median value of the array. The distance between an element x to the median is given by |x-median(X)|. You are required to return the k elements which minimize that distance. |
In Q2, what is N of the example set {9,1,7,4,4,5,7,9}? | |
5. |