Articles for category: Data Structures and Algorithms

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 ...

Delete a Node without Head Pointer

Problem Statement You are given a singly linked list and the reference to the node to be deleted in the linked list, write a program to delete that node from linked list. There is no information provided about the head pointer or any other node. The normal deletion would fail here as the linked list we ...

kth Largest Element in BST

Problem Statement We are provided with a Binary Search tree and the task is to find the $k^{th}$ largest element in BST (Binary Search Tree). Refer to the Example and Example Explanation sections for more details and the Approach section to understand how to find the $k^{th}$ largest element in bst. Example Example 1: The ...

Parenthesis Checker

Problem Statement A string expression of parenthesis with the letters "(", ")", "{", "}", "[", "]" is supplied to you. The expression is called balanced with respect to the parenthesis ifthe same type of closing brackets )", "}", "]" is used to close open brackets "(", "{", "[". The correct sequence in which they appear ...

Boundary Traversal of Binary Tree

Problem Statement A binary tree will be given in the problem and we need to find the boundary traversal of that binary tree.Boundary traversal of a binary tree means traversing the binary tree along the boundary. The boundary includes the left boundary, right boundary and leaf nodes. Therefore in the boundary traversal of binary trees ...

Inversion Count in an Array

The Inversion count in an array indicates the number of element pairs (i, j) where i < j and A[i] > A[j], serving as a measure of the array’s unsortedness. Understanding Inversion count in an Array is essential for analyzing sorting algorithms’ efficiency and optimizing them, making count inversion a key concept in algorithm design ...

DBMS MCQ

Question: What is the Full Form of DBMS? Options: Answer: b) Database Management System. Explanation:The DBMS full form is Database Management System. It is software that is used to store, manipulate, and query records stored in a certain database. We have several types of database management systems such as NoSQL database management systems (for example ...