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

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -