#
Data Structure Archive

In this post, we will see how to print all subarrays of given array. Problem Print all print all subarrays of given array. For example: If array is {1,2,3} then you need to print {1}, …

In this post, we will see Dijkstra algorithm for find shortest path from source to all other vertices. Problem You will be given graph with weight for each edge,source vertex and you need to find …

In this post, we will see about Doubly LinkedList implementation in java. We have already seen the implementation of singly linked list. You can consider this as an extension of Singly linked list.It is quite …

In this post, we will see about trie data structure in java. What is Trie : Trie is data structure which stores data in such a way that it can be retrieved faster and improve …

If you want to practice data structure and algorithm programs, you can go through data structure and algorithm interview questions. We have already seen about breadth first search in level order traversal of binary tree. Graph …

If you want to practice data structure and algorithm programs, you can go through data structure and algorithm interview questions. In previous post, we have seen breadth-first search(bfs). In this post, we will see how to …

Shell sort is in place comparison based sorting algorithm. It is generalization of insertion sort. It was invented by Donald shell. It allows to sort elements which are far apart. In case of insertion sort, comparison happens …

Counting sort is special sorting technique used to sort elements between specific range. Lets say elements belong to range 1 to K , then Counting sort can be used to sort elements in O(N) times. …

In this post, we will see how to implement heap sort in java. I will divide heap sort in multiple parts to make it more understandable. What is heap? Understanding complete binary tree Binary heaps …

In this post, we will see about quick sort in java. Quick sort or partition-exchange sort, is a sorting algorithm, which is using divide and conquer algorithm. In quick sort, we first choose a pivot …