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.

 

longest path in graph

Longest path in undirected Graph

I have introduced shortest path in graph with Dijkstra, and shortest path in matrix. Here is a question to find ...
Read More
combinations of operators and parentheses

Combinations of adding operators and parentheses

DFS (Depth first search) with memoization has been introduced in the post of word break using memoization. It uses one ...
Read More
suggested friends in java

Get suggested friends (2 solutions) – code

When you are asked to design the data structures for social network, normally the answer is graph. In the graph, ...
Read More
least common set with union find

Find Least common set with union find – code

When we have number of sets, and need to group them into joint and disjoint-sets, union–find is the algorithm to ...
Read More
autocorrect

Spell autocorrect with edit distance – Code

Google provides a powerful spell correct for validating the keywords we type into the input text box. It checks against ...
Read More
DFS and adjacent matrix

Depth first search and matrix – Code

Depth first search (DFS) is an algorithm to traverse each element in the data structure. It starts from the source ...
Read More
royal succession order

Monarchy succession order – code

Monarchy succession order is also known as The line of succession to the British throne. The succession to the British ...
Read More
Build hierarchy tree java

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 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
Autocomplete with trie java

Autocomplete with trie – Code

Autocomplete is a feature that search box returns the suggestions based on what you have typed. Autocomplete with trie provides ...
Read More
Loading...

 

Comments are closed