Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Enrolment Number :----------------------Amrita Vishwa Vidyapeetham

Amrita School of Engineering, Amritapuri


Department of Computer Science and Applications
Six Semester BCA
12CSA239 Data Structures and Algorithms
Run Time Redo Second Periodical Examination, April 2016
Time: 2 hours

Maximum Marks: 50
(Answer all questions)

1. Explain Binary tree with example.


2. What does the following code does.

(3 marks)
(3 marks)

ptr=head
while(ptr->next!=NULL)
ptr=ptr->next
ptr->next=next

3. Differentiate between single linked list and Doubly Linked List.


4. Linked list is a linear data structure. Justify.

(4 marks)
(4 marks)

5. Consider the below tree:

(7 marks)

a.
b.
c.
d.
e.
f.

Circle all the leaves.


Put a square box around the root.
Draw a star around each ancestor of the node that contains.
Put a big X through every descendant of the node the contains 10.
Which are the siblings of node 9.
Is this a binary tree? Justify

6. Write the linked list implementation of push and pop stack operations.

(8 marks)

7. Suppose a doubly linked list is maintained with Header node, write down few codes to
perform the following operation in it (with diagram)
(6
marks)
a. Insert a node at the beginning of the header doubly linked list
b. Deleting the last node from the doubly linked list.

Page 1 of 2

8. Consider the below binary tree

( 6 marks)

What are the various ways in which the above tree is represented in memory? Explain with
diagram.
9.
a. Construct a BST for the following sequence of numbers 45, 36, 76, 23, 89, 115, 98, 39, 41,
56, 69, 48.
(3 marks)
b. What sequence of elements would you obtain if you traversed this binary search tree (BST)
using
(6 marks)
a. Inorder traversal,
b. Postorder traversal
c. Preorder traversal

Page 2 of 2

You might also like