Arnab Chakraborty has Published 4293 Articles

Applications of DFS and BFS in Data Structures

Arnab Chakraborty

Arnab Chakraborty

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

19K+ 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

Binary Search Trees in Data Structures

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2019 12:13:24

794 Views

The binary search trees are binary tree which has some properties. These properties are like below −Every Binary Search Tree is a binary treeEvery left child will hold lesser value than rootEvery right child will hold greater value than rootIdeal binary search tree will not hold same value twice.Suppose we ... Read More

Preorder Tree Traversal in Data Structures

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2019 12:07:28

495 Views

In this section we will see the pre-order traversal technique (recursive) for binary search tree.Suppose we have one tree like this −The traversal sequence will be like: 10, 5, 8, 16, 15, 20, 23AlgorithmpreorderTraverse(root): Begin    if root is not empty, then       print the value of root ... Read More

Level Order Tree Traversal in Data Structures

Arnab Chakraborty

Arnab Chakraborty

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

481 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

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

973 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

Amortized time complexity in Data Structures

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2019 09:15:10

1K+ Views

Amortize AnalysisThis analysis is used when the occasional operation is very slow, but most of the operations which are executing very frequently are faster. In Data structures we need amortized analysis for Hash Tables, Disjoint Sets etc.In the Hash-table, the most of the time the searching time complexity is O(1), ... Read More

Matrix multiplication algorithm

Arnab Chakraborty

Arnab Chakraborty

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

26K+ 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

Advertisements