Question
Given a binary tree, a "zigzag" level order traversal
prints the nodes level by level, but alternating the order of nodes from left-to-right and right-to-left for successive levels. Â Â For example, Level 0 (root) is L-R, Level 1 is R-L, Level 2 is L-R, and so on. Â Â Consider the following binary tree: Â Â ``` Â Â Â Â Â 3 Â Â Â Â Â / \ Â Â Â Â 9Â 20 Â Â Â Â Â /Â \ Â Â Â Â Â 15Â Â 7 Â Â ``` Â Â What is the output of a zigzag level order traversal for this tree?ÂSolution
A zigzag level order traversal alternates the direction of traversal for each level. Â Â Â Â Â Â Level 0 (Left-to-Right): `3` Â Â Â Â Â Â Level 1 (Right-to-Left): Children of `3` are `9` (left) and `20` (right). In right-to-left order: `20, 9`. Â Â Â Â Â Â Level 2 (Left-to-Right): Children of `20` are `15` (left) and `7` (right). In left-to-right order: `15, 7`. (Node `9` has no children in this example). Â Â Â Â Combining these, the output is `3, 20, 9, 15, 7`.
If 54 [9] 3 and 108 [30] 5, then what is the value of Z in 19 [Z] 18?
Which of the following numbers will replace the question mark (?) in the given series?
380, 552, 870, ?, 1406
What comes in place of ___(A)___?
Select the option that is related to third number cluster in the same way second number cluster is related to first number cluster.
18: 162 :: 44: ?
If the shortest distance between the shop and both Alok’s and Sameer’s house is considered, then the shop is closer to whose house?
Arrange the given words in the sequence in which they occur in the dictionary.
A) Case
B) Cashier
C) Caselet
D) Cash
242, 288, ? , 392, 450
Select the option figure in which the given figure is embedded (rotation is NOT allowed).
What will come in place of ‘b’?
Select the number combination of letters that when placed sequentially in the blanks of the given series will complete the series.\
s _ u v _ x _...