I try to define Omega and O complexity of searching the lowest element in Maximum oriented heap and AVL tree. I don't know if the word "lowest" plays here big role, what it think is that Omega complexity for AVL and Max-Heap could be Omega(1) if I assume that Max-Heap has 1 node (root) and AVL only have 1 or 2 nodes (I'm not completely sure if omega complexity is strictly familiar with optimistic case, as I define above). I'm also not sure about O complexity. For AVL I think it should be O(log(n)) and for Max-heap O(n) (since we have to "visit" all leaf nodes) but I'm not sure. I would be really thankful for any suggestions and solutions.
Asked
Active
Viewed 56 times
0
-
1Just for clarification of the concepts: Omega is kind of a lower bound and O is kind of an upper bound of some function. This has nothing to do with worst or best case. You can study the Omega of the worst case behaviour or the O of the best case behaviour. – Henry Feb 04 '17 at 13:52
-
In the max-heap, even if you stumble on the lowest (=minimum) element by accident, you will still have to verify that it is indeed the minimum element. And that takes at least n/2 operations (consider all leaves of the heap). – Gassa Feb 04 '17 at 13:54
-
For Omega, you can't assume one or two nodes. It's a lower bound on T(N)*some_constant as for all *sufficiently large* N. – Matt Timmermans Feb 04 '17 at 14:00