Arnab Chakraborty has Published 3734 Articles

Binary Trees and Properties in Data Structures

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2019 11:04:14

4K+ Views

In this section we will see some important properties of one binary tree data structure. Suppose we have a binary tree like this.Some properties are −The maximum number of nodes at level ‘l’ will be $2^{l-1}$ . Here level is the number of nodes on path from root to the ... Read More

Binary Tree Representation in Data Structures

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2019 10:47:48

17K+ Views

Here we will see how to represent a binary tree in computers memory. There are two different methods for representing. These are using array and using linked list.Suppose we have one tree like this −The array representation stores the tree data by scanning elements using level order fashion. So it ... Read More

Operations on an Array in Data Structures

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2019 10:38:25

1K+ Views

Here we will see some basic operations of array data structure. These operations are −TraverseInsertionDeletionSearchUpdateThe traverse is scanning all elements of an array. The insert operation is adding some elements at given position in an array, delete is deleting element from an array and update the respective positions of other ... Read More

Matrix multiplication algorithm

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2019 08:14:18

27K+ Views

In this section we will see how to multiply two matrices. The matrix multiplication can only be performed, if it satisfies this condition. Suppose two matrices are A and B, and their dimensions are A (m x n) and B (p x q) the resultant matrix can be found if ... Read More

Step Count Method in Algorithm

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2019 08:02:11

11K+ Views

The step count method is one of the method to analyze the algorithm. In this method, we count number of times one instruction is executing. From that we will try to find the complexity of the algorithm.Suppose we have one algorithm to perform sequential search. Suppose each instruction will take ... Read More

Baum Sweet Sequence in C Program?

Arnab Chakraborty

Arnab Chakraborty

Updated on 20-Aug-2019 14:00:18

238 Views

Here we will see the Baum Sweet Sequence. This sequence is one binary sequence. If a number n has an odd number of contiguous 0s, then nth bit will be 0, otherwise nth bit will be 1.We have a natural number n. Our task is to find the n-th term ... Read More

Binary Search using pthread in C Program?

Arnab Chakraborty

Arnab Chakraborty

Updated on 20-Aug-2019 13:18:47

614 Views

We know that the binary search approach is one of the most suitable and effective sorting algorithm. This works on sorted sequence. The algorithm is simple, it simply finds the element from middle, then divide the list by two parts, and moves either towards the left sublist, or right sublist.We ... Read More

Binary representation of next greater number with same number of 1’s and 0’s in C Program?

Arnab Chakraborty

Arnab Chakraborty

Updated on 20-Aug-2019 13:15:25

331 Views

Suppose we have one binary number, that is representation of a number n. We have to find binary representation of a number which is smallest but larger than n, and it also has same number of 0s and 1s. So if the number is 1011 (11 in decimal), then the ... Read More

BFS using vectors & queue as per the algorithm of CLRS in C Program?

Arnab Chakraborty

Arnab Chakraborty

Updated on 20-Aug-2019 13:10:19

409 Views

In CLRS book the BFS algorithm is described using vectors and queue. We have to implement that algorithm using C++ STL. Let us see the algorithm at first.AlgorithmBFS(G, s) −begin    for each vertex u in G.V - {s}, do       u.color := white       u.d ... Read More

Betrothed numbers in C Program?

Arnab Chakraborty

Arnab Chakraborty

Updated on 20-Aug-2019 13:06:54

627 Views

Here we will see the Betrothed number. This is a pair of numbers, such that the sum of the proper divisors of one number is one more than the other number. We have to find these pairsFor an example, the pair is like (48, 75). So the divisors of 48 ... Read More

Advertisements