Redpine Infotech Placement: Sample Questions 2 - 3 of 19

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

Question 2


Describe in Detail


Explain two problems related to in order and post order traversal.


Given Order Travel, Root, Left Subtree and Right Subtree

Inorder Traversal

  • Algorithm:
    • Traverse the left sub tree, i.e.. . , call inorder (left-sub tree)
    • Visit the root
    • Traverse the right sub tree, i.e.. . , call inorder (right-sub tree)
  • Uses of Inorder
    • Binary search trees, inorder traversal provides nodes in non-decreasing order.
    • To get nodes of BST in non-increasing order, a variation of inorder traversal where inorder traversal is reversed can be used.


In Order Travel (Left, Root, Right)
  • In order travel (left, root, right) : 4, 2,5, 1,3

Post Order

  • Algorithm:
    • Traverse the left sub tree, i.e.. . , call Postorder (left-sub tree)
    • Traverse the right sub tree, i.e.. . , call Postorder (right-sub tree)
    • Visit the root.
  • Use of Postorder:
    • Used to delete the tree.
    • To get the postfix expression of expression tree.


Postorder (Left, Right, Root)

Postorder (Left, Right, Root) : 4 5 2 3 1

Question 3



What are the different types of IPC mechanisms?


Choice (4)


Indirect communication (mailbox)


Synchronous/Asynchronous communication (Naming.) .


Context switching


Direct communication (messages)




  • IPC mechanisms are a set of programming interfaces that allow a programmer to coordinate activities among different program processes or threads.
  • Threads can run concurrently in an operating system.
  • For example, they allow a program to handle many user requests at the same time each with different thread.
  • Direct communication is an IPC mechanism.
  • Each process that wants to communicate must name the recipient or sender of the communication.
  • Send and receive primitives are defined as bellow:
    • Send (P, message) - send a message to process P.
    • Receive (Q, message) - Receive a message from process Q.

Developed by: