Insert in a sorted linked list

Given a linked list, with all the nodes in sorted order. Write a function that inserts a new integer in the sorted manner. i.e If […]

Sorting a binary array (which has only 0 & 1)

Given an array which has only 0’s and 1’s. Write an algorithm which will sort this array. (i.e separate 0’s and 1’s by bringing 0’s […]

Shift elements in the array forward by k places

Given an array of m elements and an integer k ( total size of array >= m+k), . Write code to shift all the elements […]

Inorder successor of node in a Binary Tree

Given a pointer to the node in a binary tree, write code to find its inorder successor. You may assume each node to also have […]