1.

What is the speciality of cartesian sorting?(a) it sorts partially sorted set of data quickly(b) it considers cartesian product of elements(c) it sorts elements in less than O(logn)(d) it is a self balancing treeI'd like to ask this question from Cartesian Tree in portion Binary Trees of Data Structures & Algorithms IThis question was addressed to me in exam.

Answer»

Right choice is (a) it sorts partially sorted set of DATA quickly

The explanation is: It can sort a set which requires only some sorting or DISPLACEMENTS. for EXAMPLE consider 78, 79, 80, 82, 81, 83, In this only 81 and 82 MUST be swaped to make it a complete sorted set, in this case CARTESIAN sort comes to the rescue.



Discussion

No Comment Found

Related InterviewSolutions