1.

Binary tree sort is an in-place sorting algorithm.(a) True(b) FalseThis question was addressed to me in an online interview.This interesting question is from Sorting topic in portion Sorting of Data Structures & Algorithms II

Answer»

The correct option is (b) False

Easy EXPLANATION - In binary tree sort it is required to reserve one tree node for each array ELEMENT. Its implementation requires two pointer VARIABLES for each node. So, it requires extra memory. The worst case space complexity of binary tree sort is Θ(n). THEREFORE, binary tree sort is not an in-place sorting algorithm.



Discussion

No Comment Found

Related InterviewSolutions