Source Code

 
Coding questions and their source code

 

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

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

Autocomplete with trie – Code

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

Web scraping in Java – Jsoup and selenium

Web scraping is a great way to retrieve data and save the information. with a simple Java web scraping setup, ...
shortest path using Dijkstra java

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 ...
suggested friends

Get suggested friends (2 solutions) – DFS and Union Find

Get suggested friends is one of a coding question in social network applications. The data structures for social network is ...
longest path

Hierholzer’s algorithm to find an Euler path

An Euler path is a trail in a graph that visits every edge exactly once. Here we use graph data ...
K closest points

Find K closest points to origin – Compare Time complexity

The K closest problem is to find K closest points to the pointer(0,0) (it is called center or origin). The ...
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, ...

 

Comments are closed