Articles for category: Data Structures and Algorithms

Divide and Conquer Algorithm

Divide and Conquer is a fundamental algorithmic technique in computer science, where a problem is divided into smaller, more manageable sub-problems, solved individually, and then combined to form the final solution. Divide and conquer algorithm approach not only simplifies complex problems but also enhances computational efficiency. How Does the Divide and Conquer Algorithm Work? The divide ...

Geometric Progression

Geometric Progression (GP) is a sequence where each term results from multiplying the previous one by a constant, known as the Common Ratio. Consider folding a paper multiple times: while it’s folded 4-5 times, determining its final stack height illustrates GP principles. This progression concept offers insights into patterns formed by consistent multiplicative growth. Notation ...

Difference Between Linear Search and Binary Search

As developers, we should be aware of the basic computer science concept of search algorithms such as linear search and binary search. Finding a given element’s occurrence in a list is the process of searching. In this article, we will discuss the difference between linear search and Binary search. There are two types of searching algorithms What ...

Master Theorem

Master’s Theorem is the best method to quickly find the algorithm’s time complexity from its recurrence relation. This theorem can be applied to decreasing and dividing functions, each of which we’ll look into in detail. We can apply Master’s Theorem for: Master Theorem for Dividing Functions Highlights: Master's Theorem is the most useful and easy ...

Graph Coloring Problem

Problem Statement We are given a graph, we need to assign colors to the vertices of the graph. In the graph coloring problem, we have a graph and m colors, we need to find a way to color the vertices of the graph using the m colors such that any two adjacent vertices are not ...

Permutation of String

Problem Statement In this article we are going to discuss a variant of the Permutation of String. The problem statement goes like this, you will be given two strings, say s1 and s2. And, we need to find a substring in s2 that is a permutation of string s1. What is the Permutation of a String? The permutation of string is the set of ...

Deletion in BST

The delete function in a binary search tree removes a specified node, ensuring the binary search tree property is maintained. Three scenarios govern node deletion. This article explores the process of deleting nodes in a binary tree while introducing the fundamentals of what a binary search tree entails. To learn more about the Binary search ...

What is the Hamiltonian Graph

Overview The hamiltonian graph is the graph having a Hamiltonian path in it i.e. a path that visits each and every vertex of the graph exactly once, such graphs are very important to study because of their wide applications in real-world problems. Hamiltonian graphs are used for finding optimal paths, Computer Graphics, and many more ...