Imagine u have an unbalanced binary search tree. Now make a linked list of all the nodes at every depth(level) of the tree. Assume every node along with a left and a right pointer also has a next pointer. To make the linked list inside the binary tree for every level, the next pointer of the first node at every depth should point to the next node at the same depth in the tree and so on for the other nodes.What is the complexity of your algorithm. Improve the efficiency.Code the algorithm and then thoroughly test it?
Given a value and a binary search tree. Print all the paths(if there exists more than one) which sum up to that value. It can be any path in the tree. It doesnt have to be from the root.
Given a non-verified BST(Binary search tree), write a C/C++ code to verify if the BST is a valid one or not(basic BST rule-->data of all nodes under left node <= data of current node <= data of all nodes under right node)