Every non-leaf node has just one child in a binary tree known as a Degenerate Binary tree. The tree effectively transforms into a linked list… Read More
Category Archives: Data Structures
Given a graph with N nodes and M edges with array A[] and integer C, the task is to find the maximum score. If visiting… Read More
Geek is in a geekland which has a river and some stones in it. Initially, a geek can step on any stone. Each stone has… Read More
Given a set of N integers with up to 40 elements, the task is to partition the set into two subsets of equal size (or… Read More
Given a directed acyclic graph (DAG) with N nodes with integer representations 0 to N-1 and an integer array arr[], where arr[i] is the parent… Read More
Introduction to Stack: A stack is a linear data structure in computer science that follows the Last-In-First-Out (LIFO) principle. It is a data structure in… Read More
Given a linked list of even length, where each element is an integer, the task is to reverse the list by performing the following steps… Read More
A substring is defined as a contiguous part of a string, i.e., a string inside another string. Substrings of String “geeks” Characteristics of Substring: Starting… Read More
A subsequence is defined as a sequence that can be derived from another string/sequence by deleting some or none of the elements without changing the… Read More
Given two strings, A and B, both consisting of lowercase alphabets. You can perform the following operation any number of times: choose any index i… Read More
Given a string S of length N and an integer K. The task is to find the minimum count of distinct strings by changing at… Read More
A Max-Heap is defined as a type of Heap Data Structure in which each internal node is greater than or equal to its children. The… Read More
Given an undirected graph with N nodes and M edges in the form of array edg[][2], the task is to count all simple paths (paths… Read More
Given a number N, the problem requires shuffling the numbers from 1 to N in a way that satisfies a condition, where the sum of… Read More
Given an array nums[] of N positive integers, the task is to find the number of subsequences that can be created from the array where… Read More