ADSA
ADSA
2021
M. Tech I Year I Sem. Main & Suppl. Exams July/Aug-2021 (2020, 2019 & 2018 Batches)
Subject: Advanced Data Structures and Algorithms
Branch: AI (CSE)
Time: 3 hours Max. Marks: 70
Answer Any Five Questions (5 X 14 = 70 Marks)
All Questions Carry Equal Marks
2. a) Give a recursive method for removing all the elements from a stack.
b) Explain any one application of Queue with an example.
3. a) Give a concrete implementation of the pop method in the context of the Mutable
Mapping class, relying only on the five primary abstract methods of that class.
b) Explain why a hash table is not suited to implement a sorted map
5. a) Define Graph. Draw a simple undirected graph G that has 12 vertices, 18 edges,
and3 connected Components.
b) Compare and contrast BFS and DFS.
6. a) Describe a component from a text-editor GUI and the methods that it encapsulates.
b) Draw a class inheritance diagram for the following set of classes:
i) Class Goat extends object and adds an instance variable _tail and methods
milk( ) and jump( ).
ii) Class Pig extends object and adds an instance variable _nose and methods
eat(food) and wallow( ).
7. a) Write a Python program for a matrix class that can multiply two dimensional
arrays of numbers, assuming the dimensions agree appropriately for the operation
b) Describe the procedure to sort the nodes in a singly linked list.
*****