A singly LL is given such that there is alternate ordering between the elements.
Ex: 1->2->13->14->11->5->4->null
Give an efficient O(n) algo to sort such a LL. There can be multiple such orderings in the given LL.
1 year ago
Feel free to contribute, however it will be moderated to curb spams.
A singly LL is given such that there is alternate ordering between the elements.
Ex: 1->2->13->14->11->5->4->null
Give an efficient O(n) algo to sort such a LL. There can be multiple such orderings in the given LL.
Given a BST T and a node N in T such that all leaf nodes are connected in doubly linkedlist fashion, find height of the node N in T.