3i Infotech Papers: Sample Questions 1154  1156 of 1245
Examrace Placement Series prepares you for the toughest placement exams to top companies.
Question number: 1154
Describe in Detail
What are the traverses in binary tree?
Explanation
InOrder Traversal:

The left subtree is visited first, then the root and later the right subtree.

Outputs sorted key values in ascending order.
Algorithm

Recursively traverses left subtree.

Visit root node.

Recursively traverse right subtree.
Preorder Traversal:

Root node is visited first, then the left subtree and finally the right subtree.
Algorithm:

Visit root node.

Recursively traverse left subtree.

Recursively traverse right subtree.
Postorder Traversal

The root node is visited last, hence the name.

First we traverse the left subtree, then the right subtree and finally the root node.
Algorithm:

Recursively traverse left subtree.

Recursively traverse right subtree.

Visit root node.
Question number: 1155
Write in Short
What is a NULL Pointer? Whether it is same as an uninitialized pointer?
Explanation

Null pointer does not point to anything in the memory.

Null is defined as (void*) 0.

Uninitialized pointer on the other hand is pointing to memory location but the pointer values are not assigned.
Question number: 1156
Describe in Detail
Which bit wise operator is suitable for turning on a particular bit in a number?
Explanation

Bitwise OR operator sets a one in each bit position where one of its operands has a 1 ‘bit’. That is, output of bitwise OR is 1 if at least one of the two operands has bit 1 in corresponding position.

To set a bit in the position, just OR it with the operand with the bit set.

Bitwise OR operator is denoted by ‘ ’
Bitwise OR operation of 12 and 25