Sum and Product of the nodes of a Singly Linked List which are divisible by K

Given a singly linked list. The task is to find the sum and product of all of the nodes of the given linked list which… Read More »

Find the product of last N nodes of the given Linked List

Given a linked list and a number N. Find the product of last n nodes of the linked list. Constraints : 0 <= N <=… Read More »

Product of the nodes of a Singly Linked List

Given a singly linked list. The task is to find the product of all of the nodes of the given linked list. Examples: Input :… Read More »

Sum of alternate elements of a N x N matrix

Given an NxN matrix. The task is to find the sum of the alternate elements of the given matrix. For example, in a 2 x… Read More »

Find column with maximum sum in a Matrix

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

Find row with maximum sum in a Matrix

Given an N*N matrix. The task is to find the index of a row with the maximum sum. That is the row whose sum of… 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 »