I am a beginner in computer science and have been asked to write a program to convert a binary tree into a circular linked list (order of the nodes in list are in inorder traversal of the tree).

I would like to understand the purpose of such a conversion. May I know any real time or real life applications of such a program? Is it used as a function for implementing something bigger?


The reason that multiple data structures exist is (and there isn't any one single data structure to rule them all) is because each data structure has different performance characteristics.

It follows that, if you're moving data from one data structure to another, you're doing so because you now prefer the performance characteristics of the new data structure.

For an example of why you might want to put data into a ring structure, have a look at the LMAX Disruptor, a ring buffer data structure that enables high-speed processing of financial transactions (among other things).

  • "because you now prefer the performance characteristics of the new data structure." may i know any actual applications where you would prefer the characteristics of a circular doubly linked list containing data of a binary tree now that you are done with using the binary tree? Nov 19 '19 at 3:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.