Source code are the collections of coding questions and their source code. You will find the download link at the bottom of each page.
![autocomplete with trie listing](https://www.lavivienpost.com/wp-content/uploads/2022/07/autocomplete-with-trie-listing-300x169.jpg.webp)
Autocomplete with trie (3 solutions) – Code
Autocomplete is a feature that search box returns the suggestions based on what you have typed. Autocomplete with trie provides ...
![DFS and adjacent matrix](https://www.lavivienpost.com/wp-content/uploads/2020/09/DFS-and-adjacent-matrix1-300x169.jpg.webp)
Depth first search in matrix using recursion
An adjacency matrix is a 2d array representing a graph. The nodes are the headings for the rows and columns ...
![shortest path using Dijkstra java](https://www.lavivienpost.com/wp-content/uploads/2019/01/shortest-path-using-dijkstra-java-300x169.jpg.webp)
Shortest path and 2nd shortest path using Dijkstra – code
Dijkstra's algorithm is an algorithm to find the shortest paths between vertices in a graph. It uses greedy technique by ...
![shortest path in matrix](https://www.lavivienpost.com/wp-content/uploads/2019/12/shortest-path2-300x169.jpg.webp)
Shortest path from source to destination in matrix – Code
Shortest path in matrix is to find the shortest distance from the the source to the destination. As you know, ...
![huffman coding](https://www.lavivienpost.com/wp-content/uploads/2022/06/huffman4-300x169.jpg.webp)
Huffman coding and decoding – Step by step
What is huffman coding? Huffman coding is an algorithm to generate the binary code based on the frequencies of corresponding ...
![build hierarchy tree listing](https://www.lavivienpost.com/wp-content/uploads/2022/08/build-hierarchy-tree-listing-300x167.jpg.webp)
Build hierarchy tree – Code
Build hierarchy tree reads employee data and build a corporation hierarchy tree from the list. HashMap plays important role to ...
![detect graph cycle](https://www.lavivienpost.com/wp-content/uploads/2020/08/detect-graph-cycle2-300x169.jpg.webp)
Detect cycle and remove cycle in directed graph
A graph is a data structure that consists of a set of nodes (vertices) connected by edges. A graph is ...
![K closest points](https://www.lavivienpost.com/wp-content/uploads/2019/10/K-closest-points1-300x200.jpg.webp)
Find K closest points to origin (3 solutions) – Time complexity explained
The K closest problem is to find K closest points to the pointer(0,0) (it is called center or origin). The ...
![Prefix To Postfix](https://www.lavivienpost.com/wp-content/uploads/2019/12/Prefix-To-Postfix1-300x169.jpg.webp)
Prefix to postfix (2 solutions) – stack and recursion
In mathematics expressions, there are infix, prefix and postfix notations. Infix notation is characterized by the placement of operators between ...
![modulo operation](https://www.lavivienpost.com/wp-content/uploads/2018/02/modulo-operatoin2-300x169.jpg.webp)
Modulo operation and circular array
The modulo operation returns the remainder of one number divided by another. Modulo operator is a arithmetical operator, represented as ...