You are on page 1of 1

Nepal College of Information Technology Nepal College of Information Technology

Unit Test Unit Test


Fall 2010 Fall 2010
Program: B.E. Computer Time: 2 hrs Program: B.E. Computer Time: 2 hrs
Semester: Fall (III) FM: 70 Semester: Fall (III) FM: 70
Subject: Data Structure & Algorithms PM: 35 Subject: Data Structure & Algorithms PM: 35
Attempt all questions Attempt all questions

1. a. Explain ADT with an example. [5] 1. a. Explain ADT with an example. [5]
b. What is infix, prefix and postfix expression? Why is it needed b. What is infix, prefix and postfix expression? Why is it needed
to convert infix expression to prefix or postfix expression? to convert infix expression to prefix or postfix expression?
Write an algorithm to convert infix expression to prefix Write an algorithm to convert infix expression to prefix
expression. [10] expression. [10]
2. a. Write an algorithm to evaluate a postfix expression. Evaluate 2. a. Write an algorithm to evaluate a postfix expression. Evaluate
the following postfix expression. the following postfix expression.
23 + 5 * 91 + 75 - $ * [8] 23 + 5 * 91 + 75 - $ * [8]
b. Convert the following expression into postfix and prefix b. Convert the following expression into postfix and prefix
expression expression
i) A/B*(C*F+(A-D)*E) i) A/B*(C*F+(A-D)*E)
ii) A+(((B-C)*(D-E)+F)/G)$(H-I) [7] ii) A+(((B-C)*(D-E)+F)/G)$(H-I) [7]
3. a. Explain stack with an example. Write an algorithm to insert and 3. a. Explain stack with an example. Write an algorithm to insert and
delete an element from the stack. [8] delete an element from the stack. [8]
b. Discuss the advantage of circular queue over linear queue. b. Discuss the advantage of circular queue over linear queue.
Write a C++ code to insert and delete an item from the circular Write a C++ code to insert and delete an item from the circular
queue. [7] queue. [7]
4. a. What do you mean by linked list? Write an algorithm to insert 4. a. What do you mean by linked list? Write an algorithm to insert
an item at the beginning of a linked list and an algorithm to an item at the beginning of a linked list and an algorithm to
display the items of the list. [8] display the items of the list. [8]
b. Why do we need doubly linked list? How can you insert an b. Why do we need doubly linked list? How can you insert an
item in doubly linked list? Explain. [7] item in doubly linked list? Explain. [7]
5. Write short notes on. (Any Two) 5X2=10 5. Write short notes on. (Any Two) 5X2=10
a. Application of stack. a. Application of stack.
b. Linear queue. b. Linear queue.
c. Application of queue. c. Application of queue.

You might also like