Arnab Chakraborty has Published 3734 Articles

Sort an array according to count of set bits in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Sep-2019 11:34:23

427 Views

Here we will see one interesting problem to sort an array based on the set-bits. When an element in the array has higher number of set-bits, then that will be placed before another element which has lower number of set bits. Suppose some numbers are 12, 15, 7. So the ... Read More

Comparison of Search Trees in Data Structure

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2019 13:51:07

3K+ Views

Here we will see some search trees and their differences. There are many different search trees. They are different in nature. The basic search tree is Binary Search Tree (BST). Some other search trees are AVL tree, B tree, Red-Black tree, splay tree etc.These trees can be compares based on ... Read More

Adjacency lists in Data Structures

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2019 13:45:56

4K+ Views

The graph is a non-linear data structures. This represents data using nodes, and their relations using edges. A graph G has two sections. The vertices, and edges. Vertices are represented using set V, and Edges are represented as set E. So the graph notation is G(V, E). Let us see ... Read More

Convex Hull Example in Data Structures

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2019 13:34:33

2K+ Views

Here we will see one example on convex hull. Suppose we have a set of points. We have to make a polygon by taking less amount of points, that will cover all given points. In this section we will see the Jarvis March algorithm to get the convex hull.Jarvis March ... Read More

Optimal Binary Search Trees in Data Structures

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2019 13:03:53

2K+ Views

A set of integers are given in the sorted order and another array freq to frequency count. Our task is to create a binary search tree with those data to find minimum cost for all searches.An auxiliary array cost[n, n] is created to solve and store the solution of sub ... Read More

Binomial Distribution in Data Structures

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2019 12:41:00

500 Views

The Binomial Distribution is a discrete probability distribution Pp(n | N) of obtaining n successes out of N Bernoulli trails (having two possible outcomes labeled by x = 0 and x = 1. The x = 1 is success, and x = 0 is failure. Success occurs with probability p, ... Read More

Bernoulli Distribution in Data Structures

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2019 12:33:29

477 Views

The Bernoulli Distribution is a discrete distribution having two possible outcomes labeled by x = 0 and x = 1. The x = 1 is success, and x = 0 is failure. Success occurs with probability p, and failure occurs with probability q as q = 1 – p. So$$P\lgroup ... Read More

Applications of DFS and BFS in Data Structures

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2019 12:25:37

20K+ Views

Here we will see what are the different applications of DFS and BFS algorithms of a graph?The DFS or Depth First Search is used in different places. Some common uses are −If we perform DFS on unweighted graph, then it will create minimum spanning tree for all pair shortest path ... Read More

Level Order Tree Traversal in Data Structures

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2019 11:34:58

573 Views

In this section we will see the level-order traversal technique for binary search tree.Suppose we have one tree like this −The traversal sequence will be like: 10, 5, 16, 8, 15, 20, 23AlgorithmlevelOrderTraverse(root): Begin    define queue que to store nodes    insert root into the que.    while que ... Read More

Binary Tree Traversals in Data Structures

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2019 11:23:47

1K+ Views

In this section we will see different traversal algorithms to traverse keys present in binary search tree. These traversals are Inorder traversal, Preorder traversal, Postorder traversal and the level order traversal.Suppose we have one tree like this −The Inorder traversal sequence will be like − 5 8 10 15 16 ... Read More

Advertisements