Algorithm-finding kth next element in an array -


i couldn't solve question can please help?

for i=1 i=n/2, if a[i]<=a[2i] , a[i]<=a[2i+1] called "bst"  

what's time complexity finding kth smallest element in bst n elements?

there 2 methods:

  1. o(k ln(n)) time complexity.
  2. o(k ln(k)) time complexity + o(k) space complexity.

Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

c# - Exception when attempting to modify Dictionary -