Source Code

Source code are the collections of coding interview questions and their source code. Click the title you are interested, you will find the download link of the source code. Cannot find what you want? Please check out my github and my Java coding book.


shortest path using Dijkstra java

Shortest path and 2nd shortest path using Dijkstra – code

What is Dijkstra's algorithm? Dijkstra's algorithm is an algorithm to find the shortest paths between vertices in a graph. It ...
Read More
build hierarchy tree listing

Build hierarchy tree – Code

Build hierarchy tree reads employee data and build a corporation hierarchy tree from the list. HashMap plays important role to ...
Read More
shortest path in matrix

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, ...
Read More
autocomplete with trie listing

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 ...
Read More
Prefix To Postfix

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 ...
Read More
wordbreak with memoization

Word break using memoization – Code

Word break is to divide a string into sub-strings that defined in dictionary. The problem is usually solved with recursion ...
Read More
word ladder bidirectional bfs

Word ladder using bi-directional BFS – time complexity explained

Word ladder is to find the number of steps to convert one string to another by changing one letter at ...
Read More
DFS and adjacent matrix

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 ...
Read More
K closest points

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 ...
Read More
huffman coding

Huffman coding and decoding – Step by step

Huffman coding is an algorithm to generate the binary code based on the frequencies of corresponding characters in the input ...
Read More


Comments are closed