## Deletion from BST

Given a BST, write an efficient function to delete a given key in it.

Read More Deletion from BSTCoding made easy

Given a BST, write an efficient function to delete a given key in it.

Read More Deletion from BSTGiven a BST, write an efficient function to search a given key in it. The algorithm should return the parent node of the key and print if the key is left or right node of the parent node. If the key is not present in the BST, the algorithm should be able to determine that.

Read More Search given key in BSTA Binary Search Tree (BST) is a rooted binary tree, whose nodes each store a key (and optionally, an associated value) and each have two distinguished sub-trees, commonly denoted left and right. The tree should satisfy the BST property, which states that the key in each node must be greater than all keys stored …

Read More Insertion in BSTGiven a binary tree, write iterative and recursive solution to traverse the tree using in-order traversal. Unlike linked lists, one-dimensional arrays and other linear data structures, which are traversed in linear order, trees may be traversed in multiple ways in depth-first order (in-order, pre-order and post-order) or breadth-first order (level order traversal). Beyond these …

Read More Inorder Tree Traversal | Iterative & RecursiveGiven a binary tree, write iterative and recursive solution to traverse the tree using pre-order traversal. Unlike linked lists, one-dimensional arrays and other linear data structures, which are traversed in linear order, trees may be traversed in multiple ways in depth-first order (pre-order, pre-order and pre-order) or breadth-first order (level order traversal). Beyond these …

Read More Preorder Tree Traversal | Iterative & RecursiveGiven a binary tree, write iterative and recursive solution to traverse the tree using post-order traversal. Unlike linked lists, one-dimensional arrays and other linear data structures, which are traversed in linear order, trees may be traversed in multiple ways in depth-first order (post-order, pre-order and post-order) or breadth-first order (level order traversal). Beyond these …

Read More Postorder Tree Traversal | Iterative & RecursiveGiven a binary tree, print its nodes level by level. i.e. all nodes present at level 1 should be printed first followed by nodes of level 2 and so on.. All nodes for any level should be printed from left to right.

Read More Level Order Traversal of Binary TreeGiven a linked list, sort it using merge sort algorithm. Merge sort is an efficient, general-purpose sorting algorithm which produces a stable sort, which means that the implementation preserves the input order of equal elements in the sorted output. Mergesort is a comparison sort, i.e. it can sort items of any type for …

Read More Merge Sort for Singly Linked ListIn the previous two posts (here and here), we have introduced linked list data structure and discussed about various types of linked lists.. We also covered in great detail the various methods to construct a linked list which inserts every new node onto the front of the list. In this post, we will discuss various …

Read More Linked List Implementation | Part 2In previous post, we have introduced linked list data structure and discussed about various types of linked lists. We have also covered the applications of linked list data structure and its pros and cons with respect to arrays. In this post, we will discuss various techniques in detail to construct a singly linked list.

Read More Linked List Implementation | Part 1A linked list is a linear data structure consisting of a group of nodes where each node point to the next node by means of a pointer. Each node is composed of data and a reference (in other words, a link) to the next node in the sequence.

Read More Introduction to Linked ListsGiven a text, find all occurrences of a given pattern in it.

Read More Introduction to Pattern MatchingGiven a sorted array of integers and a target value, find out if a target exists in the array or not in O(log(n)) time. If target exists in the array, print index of it.

Read More Exponential searchGiven a sorted array of integers and a target, find out if a target exists in the array or not. If target exists in the array, print index of it.

Read More Interpolation search