# Tag Archives: Traversal

## Minimum steps to convert all top left to bottom right paths in Matrix as palindrome | Set 2

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 »

## Check if the Binary Tree contains a balanced BST of size K

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

## Arrange numbers 1 to N^2 in a Zig-Zag Matrix in ascending order

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 »

## Level order traversal in spiral form using stack and multimap

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 »

## Min number of moves to traverse entire Matrix through connected cells with equal values

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

## Minimum steps to convert all paths in matrix from top left to bottom right as palindromic paths

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 »

## Replace every node of a Linked list with the greatest element on right side

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… Read More »

## How to iterate through a Vector without using Iterators in C++

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 »

## Maximum strength in a Matrix after performing specified operations

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 »

## Traverse a given Matrix using Recursion

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

## Count of ways to traverse a Matrix according to given conditions

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 »

## How to iterate over a 2D list (list of lists) in Java

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 »

## Vertical Order Traversal in Strings

Given a string str consisting of multiple words separated by space, the task is to print the vertical order traversal of this string. Vertical order… Read More »

## Remove all special characters from a singly Linked List

Given a singly linked list where each node represents a character including special characters, the task is to remove all the occurrences of special characters… Read More »

## Finding the converging element of the diagonals in a square matrix

Given a square matrix, the task is to find the element of the matrix where the right and the left diagonal of this square matrix… Read More »