Posts by Nimish Dham

Author Biographical Info: Not available

Program for Dijkstra’s Algorithm for Adjacency List Representation in C++

By Nimish Dham

In this tutorial, we will learn a program for Dijkstra’s Algorithm for Adjacency List Representation in C++. Dijkstra’s Algorithm Dijkstra’s Algorithm is a greedy sea.... Read More

Find shortest path with exactly k edges in a directed and weighted graph in C++

By Nimish Dham

Given a directed and weighted graph, we have to find the shortest path between two vertices that have exactly k edges. In a directed graph, an edge only exists in one direction, i..... Read More

Number of unique BSTs with n nodes in C++

By Nimish Dham

A BST(Binary Search Tree) is a kind of binary tree wherein the left subtree of a node contains nodes with values less than that of the node and the right subtree of the node contai.... Read More

Reverse a stack without using extra space in O(n) in C++

By Nimish Dham

Reversing a stack made using the stack library from STL in C++ without using extra space isn’t possible as we will have to store the stack elements in some auxiliary space as.... Read More

Convert double number to 3 decimal places number in C++

By Nimish Dham

In this tutorial, we’ll be going over two methods of converting a double with any number of decimal places to a double with decimal places. The first method is arithmetic and.... Read More

std::is_integral template in C++ with examples

By Nimish Dham

Fundamental data types in C++ can be broadly divided into three categories: Integral, floating point and void type. An integral data type can be one of the following: int types- sh.... Read More

Hadamard Matrix In C++

By Nimish Dham

Hadamard matrix was created as a solution to Hadamard’s maximum determinant problem which is to find a matrix with the maximum possible determinant where an element of the ma.... Read More

K Centers problem in C++

By Nimish Dham

The K Centers problem says that given a number of cities n, select k centers such that the maximum distance of a city from a center is minimized. This problem is a well-known probl.... Read More