Basic CS-Algorithms [3i Infotech Placement]: Sample Questions 1 - 3 of 12

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 1

Algorithms

Question

MCQ▾

In binary search tree which traversal is used for getting ascending order values?

Choices

Choice (4)

a.

Inorder

b.

Preorder

c.

Post order

d.

All of the above

Answer

a.

Explanation

In binary search tree inorder traversal is used for getting ascending order values.

Algorithm of Inorder Traversel:

1. Traverse the left subtree, i.e.. , call Inorder (left-subtree)

2. Visit the root.

3. Traverse the right subtree, i.e.. , call Inorder (right-subtree)

Traverse the Right Subtree

Inorder:

5, 4,6, 1,7

Question 2

Algorithms

Write in Short

Short Answer▾

What is ALE? Explain the functions of ALE in .

Explanation

  • ALE is a control signal of MPU.
  • processor has address lines for bit address of a memory location.
  • Out of this address lines address lines were dedicated to transfer higher order address bits while the remaining lower order bits of the address were sent through another lines multiplexed with the bit data lines.
  • Control signal “ALE” was sent by the processor to indicate the operation of this bit multiplexed bus- whether it is used to send the lower order address bits or to send the data bits.

Question 3

Algorithms
Edit

Describe in Detail

Essay▾

What is done on a Push operation?

Explanation

Understanding of Push Operation
  • Insertion of any item on stack is called push.
  • An item is inserted from top of the stack.
  • On insert in stack top will be increased by

Algorithm for push operation:

Step 1: Initialization set top

Step 2: Repeat step 3 to 5 until top

Step 3: Read, item

Step 4: set top

Step 5: Set stack [top] item

Step 6: “stack overflow”

Developed by: