Question doubt

Revision en1, by anshu2002, 2022-08-07 12:30:18

There is a tree of N nodes and a integer k.In one operation you can do the following . Choose a node X other than the root node. If the distance between root and the parent of X is less than that of X ( where 1<=X<=N ) . Then X will be disconnected from it's original parent and X will be directly get connected to root. Height of the tree is the maximum distance from root to any node of tree . So find the minimum height of the tree after applying the above operation at most K times

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English anshu2002 2022-08-07 12:35:34 200
en1 English anshu2002 2022-08-07 12:30:18 500 Initial revision (published)