Data Structure is the way of storing data in computer’s memory so that it can be used easily and efficiently. There are different data-structures used… Read More

# Tag Archives: Traversal

Given a matrix mat[][] with N rows and M columns. The task is to find the minimum number of changes required in the matrix such… Read More

Given a Binary Tree, the task is to find the maximum value of GCD from any path from the root node to the leaf node.… Read More

Given a matrix mat[][] with N rows and M columns. The task is to find the minimum number of changes required in the matrix such… Read More

Given a Binary Tree and a positive integer K. The task is to check whether the Balanced BST of size K exists in a given… Read More

Given a positive integer N, the task is to print an N × N zig-zag matrix consisting of numbers from 1 to N2, such that… Read More

Given a binary tree of N nodes, the task is to print level order traversal in a spiral form. In spiral form, nodes at the… Read More

Given a matrix A[][] of dimension N*M, the task is to find the minimum number of moves required to traverse the entire matrix starting from… Read More

Given a matrix mat[][] with N rows and M columns. The task is to find the minimum number of changes required in the matrix such… Read More

Given a linked list, the task is to find the Next Greater Element for every node of the linked list. Note: For nodes with no next… Read More

Prerequisite: C++ STL, Iterators in C++ STL The iterator is not the only way to iterate through any STL container. There exists a better and… Read More

Given a matrix of N * M containing {0, 1, #}. The task is to find the maximum value of strength based on following rules: … Read More

Given a matrix arr of size N x M, the task is to traverse this matrix using recursion.Examples: Input: arr[][] = {{1, 2, 3}, {4,… Read More

Given an integer N which represents an N x N Square Matrix, the task is to print the number of ways to move from top… Read More

Given a 2D list, the task is to iterate this 2D list in Java. 2D list (list of lists) The 2D list refers to a… Read More