Find row with maximum sum in a Matrix

Given a N*N matrix. The task is to find the index of row with maximum sum. That is the row whose sum of elements are… Read More »

Find an element in an array such that elements form a strictly decreasing and increasing sequence

Given an array of positive integers, the task is to find a point/element up to which elements form a strictly decreasing sequence first followed by… Read More »

Delete all the even nodes from a Doubly Linked List

Given a doubly linked list containing N nodes, the task is to delete all the even nodes from the list. Examples: Input: Initial List =… Read More »

Sum of all nodes in a doubly linked list divisible by a given number K

Given a doubly linked list containing N nodes and given a number K. The task is to find the sum of all such nodes which… Read More »

Delete all the nodes from a doubly linked list that are smaller than a given value

Given a doubly linked list containing N nodes and a number K, the task is to delete all the nodes from the list that are… Read More »

Zig Zag Level order traversal of a tree using single queue

Write a function to print spiral order traversal of a tree. For below tree, function should print 1, 2, 3, 4, 5, 6, 7. Recommended:… Read More »

Sum of the nodes of a Singly Linked List

Given a singly linked list. The task is to find the sum of nodes of the given linked list. Task is to do A +… Read More »

Convert a String to Integer Array in C/C++

Given a string str containing numbers separated with “, “. The task is to convert it into an integer array and find the sum of… Read More »

Insertion at Specific Position in a Circular Doubly Linked List

Prerequisite: Insert Element Circular Doubly Linked List. Convert an Array to a Circular Doubly Linked List. Given the start pointer pointing to the start of… Read More »

Queries for DFS of a subtree in a tree

Given a tree of N nodes and N-1 edges. The task is to print the DFS of the subtree of a given node for multiple… Read More »

Sum of nodes at maximum depth of a Binary Tree | Iterative Approach

Given a root node to a tree, find the sum of all the leaf nodes which are at maximum depth from root node. Example: 1… Read More »

Minimum product in a grid of adjacent elements

Given an N x M grid. The task is to find the minimum product of four adjacent numbers in the same direction (up, down, left,… Read More »

Rearrange a Linked List in Zig-Zag fashion | Set-2

Given a linked list, rearrange it such that converted list should be of the form a < b > c < d > e <… Read More »

Inorder predecessor and successor for a given key in BST | Iterative Approach

Given a BST and a key. The task is to find the inorder successor and predecessor of the given key. In case, if either of… Read More »