Given a 2D array Edges[][], representing a directed edge between the pair of nodes in a Directed Acyclic Connected Graph consisting of N nodes valued… Read More

# Category Archives: Data Structures

Given an array arr[] consisting of N positive integers, the task is to replace each array element with the nearest power of GCD of all… Read More

There are many data structures like arrays, linked lists, etc. Each sort of arrangement has its strengths and weaknesses. For these reasons, it’s important to… Read More

Given a Binary Tree, the task is to remove the leaf nodes of the Binary Tree during each operation and print the count. Examples: Input: … Read More

Given two integers X and Y, the task is to find the two integers having sum X and Bitwise XOR equal to Y. Examples: Input:… Read More

A linear search or sequential search is a method for finding an element within a list. It sequentially checks each element of the list until… Read More

A linked list is a linear data structure, in which the elements are not stored at contiguous memory locations. The elements in a linked list… Read More

Given an Undirected Connected Graph in the form of a tree consisting of N nodes and (N – 1) edges, the task for each edge… Read More

Given a Binary Tree, the task is to count all paths from root to leaf which forms an Arithmetic Progression. Examples: Input: Output: 2 Explanation: The paths… Read More

Given an undirected non-weighted graph G. For a given node start return the shortest path that is the number of edges from start to all… Read More

Given an array A[] of N integers, the task is to generate an array B[] such that B[i] contains the count of indices j in… Read More

Given an array arr[] of N integers, the task is to count number of triplets (i, j, k) in the array such that a[k] <… Read More

Given a Linkedlist and two indices A and B, the task is to print a sublist starting from A and ending at B. Examples: Input:… Read More

Python List Python programming language has four collection data types namely List, Tuple, Set, and Dictionary. A list is a mutable and ordered collection i.e.,… Read More

Given a binary search tree and a node of the binary search tree, the task is to delete the node from the Binary Search tree… Read More