3710215_merged

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

GUJARAT TECHNOLOGICAL UNIVERSITY

Advanced Data Structures


SUBJECT CODE: 3710215

Type of course: Core

Prerequisite: UG level course in Data Structures

Rationale:

Teaching and Examination Scheme:

Teaching Scheme Credits Examination Marks Total


L T P C Theory Marks Practical Marks Marks
ESE(E) PA (M) PA (V) PA (I)
3 0 2 4 70 30 30 20 150

Content:

Sr. Content Total %


No Hrs Weightage

1 Dictionaries: Definition, Dictionary Abstract Data Type, 7 15


Implementation of Dictionaries.
Hashing: Review of Hashing, Hash Function, Collision Resolution
Techniques in Hashing, Separate Chaining, Open Addressing, Linear
Probing, Quadratic Probing, Double Hashing, Rehashing, Extendible
Hashing
2 Skip Lists: Need for Randomizing Data Structures and Algorithms, 5 10
Search and Update Operations on Skip Lists, Probabilistic Analysis of
Skip Lists, Deterministic Skip Lists
3 Trees: Binary Search Trees, AVL Trees, Red Black Trees, 2-3 Trees, 9 19
B-Trees, Splay Trees
4 Text Processing: Sting Operations, Brute-Force Pattern Matching, 12 25
The Boyer- Moore Algorithm, The Knuth-Morris-Pratt Algorithm,
Standard Tries, Compressed Tries, Suffix Tries, The Huffman Coding
Algorithm, The Longest Common Subsequence Problem (LCS),
Applying Dynamic Programming to the LCS Problem.
5 Computational Geometry: One Dimensional Range Searching, Two 10 21
Dimensional Range Searching, Constructing a Priority Search Tree,
Searching a Priority Search Tree, Priority Range Trees, Quadtrees, k-D
Trees.
6 Recent Trands in Hashing, Trees, and various computational geometry 5 10
methods for effeciently solving the new evolving problem

Reference Books:

1. Mark Allen Weiss, Data Structures and Algorithm Analysis in C++, 2nd Edition, Pearson, 2004
2. M T Goodrich, Roberto Tamassia, Algorithm Design, John Wiley, 2002.
Course Outcome:

After learning the course the students should be able to:


 Understand the implementation of symbol table using hashing techniques
 Develop and analyze algorithms for red-black trees, B-trees and Splay trees
 Develop algorithms for text processing applications
 Identify suitable data structures and develop algorithms for computational geometry problems

List of Experiments:
(Note: At least 12 Practicals should be performed from the list.)

1. Write a program which creates Binary Search Tree. And also implement recursive and non-
recursive tree traversing methods inorder, preorder and post-order for the BST.
2. Write a program to implement any two hashing methods. Use any one of the hashing method to
implement Insert, Delete and Search operations for Hash Table Management.
3. Explain Dictionary as an Abstract Data Type. Implement Dictionary using suitable Data Structure.
4. Write a program which creates AVLTree. Implement Insert and Delete Operations in AVL Tree.
Note that each time the tree must be balanced.
5. Implement Red-Black Tree.
6. Implement 2-3 Tree.
7. Implement B Tree.
8. Implement a program for String Matching using Boyer-Moore Algorithm on a text file content.
9. Implement a program for String Matching using Knuth-Morris-Pratt Algorithm on a text file
content.
10. Implement Huffman-Coding Method. Show the result with suitable example.
11. Implement Longest Common Subsequence(LCS) Problem using Dynamic Programming Method.
Show the DP table and also find the particular solution of given strings.
12. Implement One Dimensional and Two Dimensional Range Searching in any language.
13. Write a program which creates Priority Search Tree. Implement Insert and Search Operations in this
Tree.
14. Write a program which creates Skip Lists. Implement Insert, Search and Update Operations in
Skip-Lists.
15. Design a simple search engine to display the possible websites upon entering a search query. Use
suitable data structure for storage and retrieval.
16. Prepare a Report/Presentation on Recent trends on Hashing/Trees/Computational Geometry to
solve ay of recent evolving problem in real world.
Seat No./Enrolment No.___________

GUJARAT TECHNOLOGICAL UNIVERSITY


ME - SEMESTER– 1 • EXAMINATION – SUMMER - 2024

Subject Code:3710215 Date: 21 Jun 2024


Subject Name:Advanced Data Structures
Time:02:30 PM TO 05:00 PM Total Marks: 70
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.

Q.1 (a) Explain Boyer Moore Pattern matching algorithm with example. 07
(b) Define Red-Black tree. Also discuss solution of various cases of violations that 07
occur while inserting a node in Red-Black tree.

Q.2 (a) Write algorithm for Searching in Priority Search Tree. 07


(b) Explain Hopscotch Hashing with suitable example. 07
OR
(b) What are the properties of BST? Describe an algorithm to search largest node in 07
BST.

Q.3 (a) Describe how LCS problem can be solved using dynamic programming 07
(b) Draw the 11-item hash table resulting from hashing the keys 12, 44, 13, 88, 23, 94, 07
11, 39, 20, 16, and 5 using the hash function h(i) = (2i + 5) mod 11 and assuming
collisions are handled by quadratic probing, up to the point where the method fails
because no empty slot is found.
OR
Q.3 (a) What are the different types of imbalances that occur while deleting a node from 07
AVL trees? Explain with an example for each type of imbalance?
(b) Discuss Huffman coding method. Explain it with an example. 07

Q.4 (a) Write Knuth-Morris-Pratt Algorithm. Also compute its time complexity. 07
(b) What is Hash function? What are the collision resolution techniques? 07
OR
Q.4 (a) Discuss two dimensional range searching algorithm in detail 07
(b) Discuss Standard Tries and Compressed Tries. 07

Q.5 (a) Explain Rehashing in Brief with Example. 07


(b) What is dictionary? Demonstrate the applications of dictionary. 07
OR
Q.5 (a) What is Skip list? Write pseudo code for inserting a node in skip list. 07
(b) What is B-Tree? Discuss advantage of using it. Show one example of such tree of 07
order 4.

***************
Seat No.: ________ Enrolment No.___________

GUJARAT TECHNOLOGICAL UNIVERSITY


ME - SEMESTER– 1 • EXAMINATION – WINTER - 2023

Subject Code:3710215 Date: 24 Jan 2024


Subject Name:Advanced Data Structures
Time:10:30 AM TO 01:00 PM Total Marks: 70
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
Seat No.: ________ Enrolment No.___________

GUJARAT TECHNOLOGICAL UNIVERSITY


ME - SEMESTER– 1 EXAMINATION – SUMMER - 2023

Subject Code:3710215 Date:14 Jul 2023


Subject Name: Advanced Data Structures
Time:02:30 PM TO 05:00 PM Total Marks: 70
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.

Q.1 (a) Explain with example the process of searching an element in skip list. 07
(b) What are the properties of BST? Describe an algorithm to traverse node in preorder. 07
Q.2 (a) Construct a tree for the given inorder and postorder traversals Inorder 07
DGBAHEICFand Postorder GDBHIEFCA
(b) Insert the following letters into an empty B-tree of order 5: C N G A H E K Q M F W L 07
TZDPRXYS
OR
(b) Build an AVL tree for inserting 13, 16, 10, 8, 5, 4, 15, 12, 9 values. After this insertion 07
delete 53 and 11. Show the step by step construction
Q.3 (a) What is hash table and hash function? Discuss and analyze various ways to define hash 07
function?
(b) What is 2-3 tree? How is it better than other search trees? Construct a 2-3 B tree for the 07
list I,N,T,E,R,N,E,T
OR
Q.3 (a) Why rehashing is needed? State different ways in which rehashing can be implemented. 07
Write a procedure to implement dictionary using suitable data structure.
(b) Construct Red and Black tree for keys 10,20,-10,15,17,40,50,60. 07
Q.4 (a) Construct the open hash table (separate chaining) and closed hash table (open addressing 07
– use linear probing) for the input: 42, 10, 36, 67, 50, 91, 64, 77, 57, 91 using the hash
function h(k) = k mod 10. Explain each step in detail.
(b) Given two sequences, find the length of longest subsequence present in both of 07
them. Find LCS for input sequences “HUMAN” and “CHIMPANZEE”
OR
Q.4 (a) Explain The Knuth-Morris-Pratt Algorithm with example. 07
(b) What is K-D Tree? Create K-D Tree for inserting (2, 5), (16, 14), (12, 14), (5, 11), (8, 07
1), (3, 7), (10, 19) values. Delete (12, 16) and (3, 7). Draw tree after each operation.
Q.5 (a) Consider the following list of string to create tries :cat,bat,ball,rat,cap,be. 07
(b) A file contains the following characters with the frequencies as shown. If 07
Huffman Coding is used for data compression, determine-
1. Huffman Code for each character
2. Average code length
3. Length of Huffman encoded message (in bits)
Characters A E I O U S T
Frequencies 10 15 12 3 4 13 1
OR
Q.5 (a) What is one dimensional range searching? Describe an algorithm of creating one 07
dimensional range search.
(b) What is priority search tree? Explain how Searching in a Priority Search Tree 07
performed.

1
Seat No.: ________ Enrolment No.___________

GUJARAT TECHNOLOGICAL UNIVERSITY


ME - SEMESTER– 1 (NEW) • EXAMINATION – WINTER - 2022

Subject Code: 3710215 Date: 24 Feb 2023


Subject Name: Advanced Data Structures
Time:10:30 AM TO 01:00 PM Total Marks: 70
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.

Q.1 (a) What is Open addressing in hashing? Discuss various methods of doing it. 07
(b) Where can Dictionary be used and how? Explain different ways of 07
implementing Dictionaries.
Q.2 (a) Discuss Priority range trees. 07
(b) Discuss one dimension and two dimension range searching. 07
OR
(b) Explain Quad tree. 07
Q.3 (a) What is meant by a search tree? Discuss 2-3 Tree. 07
(b) Discuss creation of K-D tree with an example. 07
OR
Q.3 (a) Discuss algorithm of Insert operation in the Skip list. 07
(b) How does a red black tree ensure balance? Explain with an example. Label R 07
for a Red node and B for a Black node in the explanation.
Q.4 (a) Discuss Brute-Force pattern matching algorithm. Count total number of 07
comparison to search Pattern (P) from the Text (T), as given below:
T: abacaabaccabacabaabb
P: abacab
Show all intermediate comparisons.
(b) Discuss AVL tree and different rotations while performing insertion in the tree. 07
OR
Q.4 (a) What are applications of pattern matching algorithms? Discuss Boyer Moore 07
algorithm.
(b) Discuss Splay tree and its three cases which are considered while restructuring 07
the tree. Also, for the following part of tree, apply Zig-Zig rotation considering
newly added node is x.

Q.5 (a) Discuss Longest common subsequence problem along with its applications and 07
a way to find/solve it.
(b) Discuss Standard Trie and Compressed Trie. 07
1
OR
Q.5 (a) Is KMP algorithm better than Boyer Moore algorithm? Justify your answer. 07
(b) Create a Binary Search Tree for the given input sequence : 500, 300, 400, 350, 07
375, 360. What would be the worst case time required to search a node in such
type of tree (having similar pattern of inputs)?

*************

2
Seat No.: ________ Enrolment No.___________

GUJARAT TECHNOLOGICAL UNIVERSITY


ME - SEMESTER– 1 (NEW) • EXAMINATION – SUMMER - 2022

Subject Code:3710215 Date: 27 Jul 2022


Subject Name:Advanced Data Structures
Time:02:30 PM TO 05:00 PM Total Marks: 70
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.

Q.1 (a) Explain k-D tree. 07


(b) What is dictionary? Demonstrate the applications of dictionary. 07
Q.2 (a) Discuss Insert algorithm for Insert operation in Binary Search Tree. Also give 07
one example to explain it.
(b) What is hash table and hash function? Discuss and analyze various ways to 07
define hash function?
OR
(b) What is skip lists? Describe about various operation performed on skip lists 07
with examples.
Q.3 (a) Explain Quad tree. 07
(b) Define B-tree. Explain with example how B-tree is constructed. 07
OR
Q.3 (a) Explain Brute-Force Pattern Matching algorithm. 07
(b) Explain with example an algorithm to construct the Huffman code. 07
Q.4 (a) Write Knuth-Morris-Pratt Algorithm. Also compute its time complexity. 07
(b) Explain priority search tree with example. 07
OR
Q.4 (a) Explain Boyer Moore Pattern matching algorithm with example. 07
(b) Explain how to find out Longest Common Subsequence of two strings using 07
Dynamic Programming method. Find any one Longest Common Subsequence
of given two strings using Dynamic Programming.
X=abbacdcba and Y=bcdbbcaa.
Q.5 (a) Which Data structures can be used for 1-D Range searching? Explain any three 07
with example.
(b) Consider the insertion of items with the following keys (in the given order) into 07
an initially empty AVL tree: 44, 17, 32, 78, 50, 88, 48, 62, 54. Draw step by
step tree.
OR
Q.5 (a) Explain Two Dimensional Range Searching. 07
(b) List out various recent trends in hashing and explain one of them in detail. 07

*************

You might also like