## Level Order Traversal in Zig Zag pattern OR Print in Spiral Pattern

Objective: Given a binary Tree, Do Level Order Traversal in Zig Zag pattern OR Print in Spiral Input: A Binary Tree Output: Order Traversal in Zig Zag pattern OR Print in Spiral.

Skip to content# Category: Microsoft Interview

## Level Order Traversal in Zig Zag pattern OR Print in Spiral Pattern

## Find the first repeated element in an array by its index

## Given two binary trees, check if one binary tree is a subtree of another

## In a Binary Tree, Create Linked Lists of all the nodes at each depth.

## Level Order Traversal, Print each level in separate line.

## Swap Every Kth Node in a LinkedList

## Remove Duplicates from an Unsorted Linked list

## String Compression using count of repeated characters – Run Length Encoding

## Replace all spaces in a String with ‘%20’

## Find Whether Two Strings are Permutation of each other

## Find Intersection Point in Two Linked List

## Rearrange Positive and Negative Numbers of Array On Each Side in O(nlogn)

## Find a pair of numbers from an array whose sum equals k

## Check If String has All Unique Characters

## Find an Element in 2 dimensional sorted array

@tutorialhorizon

Objective: Given a binary Tree, Do Level Order Traversal in Zig Zag pattern OR Print in Spiral Input: A Binary Tree Output: Order Traversal in Zig Zag pattern OR Print in Spiral.

Objective: Given an array of integers, find out the first repeated element. First repeated element means the element occurs atleast twice and has smallest index. Input: An Array Output: The first repeated element Examples...

Objective: Given two binary trees, check if one binary tree is a subtree of another Input: Two binary trees Output: True or false based on whether one tree is subtree of another Example :...

Objective: Given a Binary tree create Linked Lists of all the nodes at each depth , say if the tree has height k then create k linked lists. NOTE : This problem is very...

Objective: Given a Binary tree , Print each level of a tree in separate line. NOTE : This problem is very similar ” Create Linked Lists of all the nodes at each depth “...

Objective: Given a linked list, swap every kth node in that. If at the end of the list remaining nodes are less than k, leave them untouched. Input: A linked list, A number k....

Objective: Write a program to remove the duplicates from an unsorted linked list Example: Input Linked List : 1->2->2->4->3->3->2 Output : 1->2->4->3 Input: An unsorted linked list Output: Linked list with no duplicates. Approach:...

Objective: Write an algorithm to compress the given string by using the count of repeated characters and if new compressed string length is not smaller than the original string then return the original string....

Objective: Write an algorithm to replace all spaces in a given string with ‘%20’. You can consider that string has enough space at the end of the string to hold the extra characters. Input:...

Objective: Given Two Strings, check whether one string is permutation of other Input: Two Strings Output: True or false based on whether strings are permutation of other or not. Example: “sumit” and “tiums” are...

Objective: Given Two linked list, check whether both list intersect each other, if yes then find the starting node of the intersection. Intersection point means end of one linked list is linked with some...

Objective: Rearrange Positive and Negative Numbers of an Array so that one side you have positive numbers and other side with negative Integers without changing their respective order. Example : Input : 1 -2...

Objective: Write an algorithm to find out whether in a given array there exists or not two numbers whose sum is exactly equals to a given number. This problem has been asked in Amazon...

Objective: Write an algorithm to find out whether in a given string contains all the unique characters. This question has been asked in the Amazon and Microsoft interviews. Input: A String Output: True or...

Objective : Write an algorithm to find an Element in 2 dimensional array where rows and columns are sorted respectively. Input: A two dimensional sorted array, arrA[][]. Output : True or false based...

%d bloggers like this: