Skip to content

Tag Archives: Traversal

Given an array arr[] of size N, the task is to check whether the sum of first N – 1 element of the array is… Read More
Given a linked list, every node of which consists of a pair of integer variables first and second to hold the data, and a pointer… Read More
Given a linked list and it may consist of duplicate nodes. The task is to find the sum of non-duplicate nodes. Examples: Input: 1 ->… Read More
Given an integer k and a linked list, every node of which consists of a pair of integer variable first and second to hold the… Read More
Given a linked list, the task is to find the sum of all the nodes which are greater than the node next to them. Note… Read More
Given a mat[][] of size n X n, the task is to find an element X such that if the anti-clockwise traversal is begun from… Read More
Given a linked list, the task is to find the sum of even and odd nodes in it separately. Examples: Input: 1 -> 2 ->… Read More
Given a Complete Binary Tree as an array, the task is to print all of its levels in sorted order. Examples: Input: arr[] = {7,… Read More
Given a Binary Tree, the task is to print the Reverse zigzag Order of the tree. Examples: Input: 1 / \ 2 3 / \… Read More
Given a linked list. The task is to change the value of the previous and next node of a node to 0 if the current… Read More
Given a Binary Tree, the task is to find the Coefficient of Range in it. Range is defined as the difference between the maximum and… Read More
Given a binary tree and a node in the binary tree, find Levelorder successor of the given node. That is, the node that appears after… Read More
Given a binary tree and a node in the binary tree, find Levelorder Predecessor of the given node. That is, the node that appears before… Read More
Given an N-ary tree, print all the levels with odd and even number of nodes in it.  Examples:  For example consider the following tree 1… Read More
You are given a matrix of order N*N. The task is to find the resultant matrix by adding the mirror image of given matrix with… Read More