Articles for category: Data Structures and Algorithms

Backtracking Algorithm

Backtracking is an improvement of the bruteforce approach. It tries to search for a solution to a problem among all the available options. It finds a solution set by developing a solution step by step, increasing levels with time, using recursive calling. Takeaways Backtracking is a general algorithm for finding solutions to some computational problems, ...

What is Separate Chaining?

Separate Chaining is one of the techniques that is used to resolve the collision. It is implemented using linked lists. This method combines a linked list with a hash table in order to resolve the collision. In this method, we put all the elements that hash to the same slot in the linked list. Scope ...

Sparse Matrix

Sparse matrices are very useful entities in computer science, they appear in the fields of computer graphics, recommender systems, machine learning, information retrieval, maps and graph-based applications, social networks to count a few. So sparse matrices are very useful in computer science as they appear so frequently, Hence, we will be addressing questions like what ...

Segment Tree

What is a segment tree?A flexible tree-based data structure that is used to effectively solve problems involving range query operations. Takeaways A Segment Tree is a data structure that allows answering range queries over an array effectively, while still being flexible enough to allow modifying the array. What is Segment Tree? A segment tree enters ...

B Tree

B tree is an m-way tree which self balances itself. Such trees are extensively used to organize and manage gigantic datasets and ease searches due to their balanced nature. Takeaways Introduction to B Tree in Data Structure Binary trees can have a maximum of 2 children while a Multiway Search Tree, commonly known as a ...

Level Order Traversal of Binary Tree

Level Order Traversal is a technique used to traverse a Tree where all nodes at the same level are visited entirely before moving to the next level. The level order traversal of this tree will be as follows: Working of Level Order Traversal Level order traversal involves visiting all nodes at a lower level before ...

Non Linear Data Structure

A Non Linear Data Structure is one in which its elements are not connected in a linear fashion, as suggested by its name itself. In such a data structure elements might be connected in a hierarchical manner like a tree or graph, or it may be non hierarchical like in a LinkedList. Non Linear Data ...

Segment tree with lazy propagation

A Segment Tree is an efficient and flexible data structure that is used to solve range queries while handling updates at the same time. The lazy Propagation technique is used in a segment tree to solve range queries in O(log n) time complexity. In lazy propagation, we make copy nodes for each node in the ...

Difference Between Min Heap and Max Heap

A Heap is a special tree-based data structure where the tree is organized as a complete binary tree. Due to this structure, a heap with N nodes has a height of log N. It’s particularly valuable for efficiently removing the highest or lowest priority element. Typically represented as an array, there are two main types ...

Articulation Points and Bridges

Articulation Points in a network represent single points of failure. That is if we remove a vertex that is an articulation point in the network the number of connected components in that network increases. A connected component is defined as a sub-graph or a sub-network in which one node can be reached from every other ...