GUJARAT TECHNOLOGICAL UNIVERSITY COMPUTER ENGINEERING (07) / INFORMATION TECHNOLOGY (16) / INFORMATION & COMMUNICATION TECHNOLOGY (32) DATA STRUCTURES

Similar documents
R13. II B. Tech I Semester Supplementary Examinations, May/June DATA STRUCTURES (Com. to ECE, CSE, EIE, IT, ECC)

Syllabus for Bachelor of Technology. Computer Engineering. Subject Code: 01CE0301. Subject Name: Data Structure. B.Tech. Year - II

R10 SET - 1. Code No: R II B. Tech I Semester, Supplementary Examinations, May

End-Term Examination Second Semester [MCA] MAY-JUNE 2006

Table of Contents. Chapter 1: Introduction to Data Structures... 1

INSTITUTE OF AERONAUTICAL ENGINEERING

DYNAMIC MEMORY ALLOCATION AND DEALLOCATION

VALLIAMMAI ENGINEERING COLLEGE

17CS33:Data Structures Using C QUESTION BANK

Course Name: B.Tech. 3 th Sem. No of hours allotted to complete the syllabi: 44 Hours No of hours allotted per week: 3 Hours. Planned.

PESIT Bangalore South Campus Department of MCA Course Information for

Prepared By: Ms. Nidhi Solanki (Assist. Prof.) Page 1

Department of Computer Science and Technology

Sample Question Paper

E.G.S. PILLAY ENGINEERING COLLEGE (An Autonomous Institution, Affiliated to Anna University, Chennai) Nagore Post, Nagapattinam , Tamilnadu.

R10 SET - 1. Code No: R II B. Tech I Semester, Supplementary Examinations, May

DATA STRUCTURE : A MCQ QUESTION SET Code : RBMCQ0305

CS8391-DATA STRUCTURES QUESTION BANK UNIT I

APJ ABDUL KALAM TECHNOLOGICAL UNIVERSITY THIRD SEMESTER B.TECH DEGREE EXAMINATION, JULY 2017 CS205: DATA STRUCTURES (CS, IT)

1 P a g e A r y a n C o l l e g e \ B S c _ I T \ C \

VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur

Bachelor Level/ First Year/ Second Semester/ Science Full Marks: 60 Computer Science and Information Technology (CSc. 154) Pass Marks: 24

Introduction p. 1 Pseudocode p. 2 Algorithm Header p. 2 Purpose, Conditions, and Return p. 3 Statement Numbers p. 4 Variables p. 4 Algorithm Analysis

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

A6-R3: DATA STRUCTURE THROUGH C LANGUAGE

A6-R3: DATA STRUCTURE THROUGH C LANGUAGE

CS 8391 DATA STRUCTURES

ASSIGNMENTS. Progra m Outcom e. Chapter Q. No. Outcom e (CO) I 1 If f(n) = Θ(g(n)) and g(n)= Θ(h(n)), then proof that h(n) = Θ(f(n))

Algorithms and programs, basic idea of pseudo-code.algorithm efficiency and analysis, time and space analysis of algorithms order notations.

CS301 - Data Structures Glossary By

QUESTION BANK. Prepared by,mrs.d.maladhy AP/IT,RGCET. Page 1

MLR Institute of Technology

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)

CS8391-DATA STRUCTURES

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

PROGRAMMING IN C++ (Regulation 2008) Answer ALL questions PART A (10 2 = 20 Marks) PART B (5 16 = 80 Marks) function? (8)

Draw a diagram of an empty circular queue and describe it to the reader.

Tribhuvan University Institute of Science and Technology Computer Science and Information Technology (CSC. 154) Section A Attempt any Two questions:

Visit ::: Original Website For Placement Papers. ::: Data Structure

Objective Questions for Online Practical Exams under CBCS Scheme Subject: Data Structure-I (CS-113)

FORTH SEMESTER DIPLOMA EXAMINATION IN ENGINEERING/ TECHNOLIGY- MARCH, 2012 DATA STRUCTURE (Common to CT and IF) [Time: 3 hours

Fundamentals of Data Structure

1. Attempt any three of the following: 15

Data Structures Question Bank Multiple Choice

DS ata Structures Aptitude

Answers. 1. (A) Attempt any five : 20 Marks

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION

a) State the need of data structure. Write the operations performed using data structures.

DATA STRUCTURES THROUGH C++

12 Abstract Data Types

Total No. of Questions :09] [Total No. of Pages : 02. II/IV B.Tech. DEGREE EXAMINATIONS, NOV/DEC First Semester CSE/IT DATA STRUCTURES USING C

Course Review for Finals. Cpt S 223 Fall 2008

FINALTERM EXAMINATION Fall 2009 CS301- Data Structures Question No: 1 ( Marks: 1 ) - Please choose one The data of the problem is of 2GB and the hard

Adapted By Manik Hosen

Bharati Vidyapeeth s College Of Engineering for Women Pune-43 Department E & TC. SE- Unit Test I Subject-DS

DATA STRUCTURE. 1- What data structure can be used to check if a syntax has balanced paranthesis? A - queue B - tree C - list D - stack

SAURASHTRA UNIVERSITY

Chapter 4 Trees. Theorem A graph G has a spanning tree if and only if G is connected.

VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING QUESTION BANK

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)

2HS306 Applied Engineering Mathematics [ ]

Data Structures. 1. Each entry in a linked list is a called a (a)link (b)node (c)data structure (d)none of the above

DHANALAKSHMI COLLEGE OF ENGINEERING Tambaram, Chennai

Second Semester - Question Bank Department of Computer Science Advanced Data Structures and Algorithms...

7.1 Introduction. A (free) tree T is A simple graph such that for every pair of vertices v and w there is a unique path from v to w

FORTH SEMESTER DIPLOMA EXAMINATION IN ENGINEERING/ TECHNOLIGY- OCTOBER, 2012 DATA STRUCTURE

CS DATA STRUCTURES AND ALGORITHMS

DATA STRUCTURES USING C

( ) ( ) C. " 1 n. ( ) $ f n. ( ) B. " log( n! ) ( ) and that you already know ( ) ( ) " % g( n) ( ) " #&

UCS-406 (Data Structure) Lab Assignment-1 (2 weeks)

MID TERM MEGA FILE SOLVED BY VU HELPER Which one of the following statement is NOT correct.

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

Course Review. Cpt S 223 Fall 2009

1) What is the primary purpose of template functions? 2) Suppose bag is a template class, what is the syntax for declaring a bag b of integers?

EC8393FUNDAMENTALS OF DATA STRUCTURES IN C Unit 3

I Year MCA I Semester L T P To C FOUNDATIONS OF INFORMATION TECHNOLOGY

Summer Final Exam Review Session August 5, 2009

COSC 2007 Data Structures II Final Exam. Part 1: multiple choice (1 mark each, total 30 marks, circle the correct answer)

DATA STRUCTURES AND ALGORITHMS

logn D. Θ C. Θ n 2 ( ) ( ) f n B. nlogn Ο n2 n 2 D. Ο & % ( C. Θ # ( D. Θ n ( ) Ω f ( n)

Cpt S 223 Fall Cpt S 223. School of EECS, WSU

UNIVERSITY OF WATERLOO DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING E&CE 250 ALGORITHMS AND DATA STRUCTURES

Course Review. Cpt S 223 Fall 2010

Section I. 1 Review of user defined function,recursion, pointer, structure 05 2 Introduction to Data Structures and stack

DEPARTMENT OF COMPUTER APPLICATIONS B.C.A. - FIRST YEAR ( REGULATION) SECOND SEMESTER LESSON PLAN SRM INSTITUTE OF SCIENCE AND TECHNOLOGY

& ( D. " mnp ' ( ) n 3. n 2. ( ) C. " n

ECE250: Algorithms and Data Structures Midterm Review

First Semester - Question Bank Department of Computer Science Advanced Data Structures and Algorithms...

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING B.E SECOND SEMESTER CS 6202 PROGRAMMING AND DATA STRUCTURES I TWO MARKS UNIT I- 2 MARKS

Multiple Choice. Write your answer to the LEFT of each problem. 3 points each

AP Computer Science 4325

ROOT: A node which doesn't have a parent. In the above tree. The Root is A.

Data Structure. IBPS SO (IT- Officer) Exam 2017

Frequently asked Data Structures Interview Questions

Government of Karnataka Department of Technical Education Bengaluru

PA3 Design Specification

LESSON PLAN B.C.A. - FIRST YEAR ( REGULATION) SECOND SEMESTER


S.Y. B.Sc. (IT) : Sem. III. Data Structures

Discuss the following operations on One-Dimensional array with algorithms.

Transcription:

GUJARAT TECHNOLOGICAL UNIVERSITY COMPUTER ENGINEERING () / INFMATION TECHNOLOGY (6) / INFMATION & COMMUNICATION TECHNOLOGY (32) DATA STRUCTURES Type of course: Compulsory SUBJECT CODE: 2302 B.E. 3 rd Semester Prerequisite: Computer Programming & utilization Rationale: Data structure is a subject of primary importance in Information and Communication Technology. Organizing or structuring data is important for implementation of efficient algorithms and program development. Efficient problem solving needs the application of appropriate data structure during program development. Understanding of data structures is essential and this facilitates the understanding of the language. The practice and assimilation of data structure techniques is essential for programming. The knowledge of C language and data structures will be reinforced by practical exercises during the course of study. The course will help students to develop the capability of selecting a particular data structure. Teaching and Examination Scheme: Teaching Scheme Credits Examination Marks Total L T P C Theory Marks Practical Marks Marks ESE PA (M) PA (V) PA (E) PA ALA ESE OEP (I) 4 0 4 8 70 20 0 20 0 20 50 Contents: Sr. No. Topics INTRODUCTION TO DATA STRUCTURE: Data Management concepts, Data types primitive and non-primitive, Performance Analysis and Measurement (Time and space analysis of algorithms-average, best and worst case analysis), Types of Data Structures- Linear & Non Linear Data Structures. 2 LINEAR DATA STRUCTURE Array: Representation of arrays, Applications of arrays, sparse matrix and its representation Stack: Stack-Definitions & Concepts, Operations On Stacks, Applications of Stacks, Polish Expression, Reverse Polish Expression And Their Compilation, Recursion, Tower of Hanoi Queue: Representation Of Queue, Operations On Queue, Circular Queue, Priority Queue, Array representation of Priority Queue, Double Ended Queue, Applications of Queue Linked List: Singly Linked List, Doubly Linked list, Teaching Hrs. Module Weightage 0 3 30

Circular linked list,linked implementation of Stack, Linked implementation of Queue, Applications of linked list. 3 NONLINEAR DATA STRUCTURE : Tree-Definitions and Concepts, Representation of binary tree, Binary tree traversal (Inorder, postorder, preorder), Threaded binary tree, Binary search trees, Conversion of General Trees To Binary Trees, Applications Of Trees- Some balanced tree mechanism, eg. AVL trees, 2-3 trees, Height Balanced, Weight Balance, Graph-Matrix Representation Of Graphs, Elementary Graph operations,(breadth First Search, Depth First Search, Spanning Trees, Shortest path, Minimal spanning tree ) 4 HASHING AND FILE STRUCTURES : Hashing: The symbol table, Hashing Functions, Collision- Resolution Techniques, File Structure: Concepts of fields, records and files, Sequential, Indexed and Relative/Random File Organization, Indexing structure for index files, hashing for direct files, Multi-Key file organization and access methods. 5 Sorting & Searching: Sorting Bubble Sort, Selection Sort, Quick Sort, Merge Sort Searching Sequential Search and Binary Search 3 30 06 5 06 5 Reference Books:. An Introduction to Data Structures with Applications. by Jean-Paul Tremblay & Paul G. Sorenson Publisher-Tata McGraw Hill. 2. Data Structures using C & C++ -By Ten Baum Publisher Prenctice-Hall International. 3. Fundamentals of Computer Algorithms by Horowitz, Sahni,Galgotia Pub. 200 ed. 4. Fundamentals of Data Structures in C++-By Sartaj Sahani. 5. Data Structures: A Pseudo-code approach with C -By Gilberg & Forouzan Publisher- Thomson Learning. Course Outcome: After learning the course the students should be able:. Differentiate primitive and non primitive structures 2. Design and apply appropriate data structures for solving computing problems. 3. Apply sorting and searching algorithms to the small and large data sets. List of Practical: At least 0 practical should be performed by students using programming language.. Introduction to pointers. Call by Value and Call by reference. 2. Introduction to Dynamic Memory Allocation. DMA functions malloc(), calloc(), free() etc. 3. Implement a program for stack that performs following operations using array. (a) PUSH (b) POP (c) PEEP (d) CHANGE (e) DISPLAY 4. Implement a program to convert infix notation to postfix notation using stack. 5. Write a program to implement QUEUE using arrays that performs following operations (a) INSERT (b) DELETE (c) DISPLAY

5. Write a program to implement Circular Queue using arrays that performs following operations. (a) INSERT (b) DELETE (c) DISPLAY 6. Write a menu driven program to implement following operations on the singly linked list. (a) Insert a node at the front of the linked list. (b) Insert a node at the end of the linked list. (c) Insert a node such that linked list is in ascending order.(according to info. Field) (d) Delete a first node of the linked list. (e) Delete a node before specified position. (f) Delete a node after specified position. 7. Write a program to implement stack using linked list. 8. Write a program to implement queue using linked list. 9. Write a program to implement following operations on the doubly linked list. (a) Insert a node at the front of the linked list. (b) Insert a node at the end of the linked list. (c) Delete a last node of the linked list. (d) Delete a node before specified position. 0. Write a program to implement following operations on the circular linked list. (a) Insert a node at the end of the linked list. (b) Insert a node before specified position. (c) Delete a first node of the linked list. (d) Delete a node after specified position. 0. Write a program which create binary search tree.. Implement recursive and non-recursive tree traversing methods inorder, preorder and postorder traversal. 2. Write a program to implement Queue Sort 3. Write a program to implement Merge Sort 4. Write a program to implement Bubble Sort 5. Write a program to implement Binary Search. Open Ended Problem: ) Simulate a simple dictionary. Assume each character contains at least 0 vocabularies. Create an index page for all characters. Retrieve the word using index value. Assume that the index characters from a to z. 2) Design a simple search engine to display the possible websites upon entering a search query. Use suitable data structure for storage and retrieval. 3) Design and Develop the index for a text book of at least 00 pages using alphabets. 4) Design a Student Prerequisite Subjects Management System requires the use of linked list or tree to store different courses and their prerequisites and based on this list it will allow any student to take any course or not. 5) Write a program that uses the radix sort to sort 000 random digits. Print the data before and after the sort. Each sort bucket should be a linked list. At the end of the sort, the data should be in the original array. ACTIVE LEARNING ASSIGNMENTS: Preparation of power-point slides, which include videos, animations, pictures, graphics for better understanding theory and practical work The faculty will allocate chapters/ parts of chapters to groups of students so that the entire syllabus to be covered. The power-point slides should be put up on the web-site of the College/ Institute, along with the names of the students of the group, the name of the faculty, Department and College on the first slide. The best three works should submit to GTU.

Seat No.: Enrolment No. GUJARAT TECHNOLOGICAL UNIVERSITY BE - SEMESTER III (NEW) - EXAMINATION SUMMER 207 Subject Code: 2302 Date: 3/05/207 Subject Name: Data Structure Time: 0:30 AM to 0:00 PM Total Marks: 70 Instructions:. Attempt all questions. 2. Make suitable assumptions wherever necessary. 3. Figures to the right indicate full marks. Q. Short Questions 4 Arithmetic expression evaluation is an explanation of which data structure? 2 How many stacks are needed to implement a queue. Consider the situation where no other data structure like arrays, linked list is available. 3 A graph containing only isolated nodes is called a. 4 What is the 2 s complement representation for integer 5 in modulo 6? 5 What is the result of 7+7 using 2 s complement representation and modulo 6 arithmetic. 6 In which type of tree, each leaf node is kept at the same distance from root? 7 What is the reverse polish notation for infix expression a / b *c? 8 What does the following function do for a given Linked List with first node as head? void fun(struct node* head) { if(head == NULL) return; fun(head->next); printf("%d ", head->data); } 9 Which of the traversal technique outputs the data in sorted order in a Binary Search Tree? 0 What is common in inorder, preorder and postorder traversal? MARKS For sorting GB of data with only 00 MB of available main memory. Which sorting technique will be most appropriate? 2 In 2-3 trees, what do leaves contain and what do nonleaf nodes indicate? 3 Consider a situation where swap operation is very costly. Which of the sorting algorithms should be preferred so that the number of swap operations are minimized in general? 4 Draw tree whose postorder traversal is C B F E G D A

Q.2 (a) Write an algorithm for finding average of given numbers. Calculate time complexity. (b) Given Inorder and Preorder traversal, find Postorder traversal. Inorder traversal = {4, 2, 5,, 3, 6} Preorder traversal = {, 2, 4, 5, 3, 6} (c) Consider an example where the size of the queue is four elements. Initially the queue is empty. It is required to insert symbols A, B and C. delete A and B and insert D and E. Show the trace of the contents of the queue. (c) Insertion sequence of names is Norma, Roger,John,Bill,Leo,Paul, Ken and Maurice (i) Show the behavior of creating a lexically ordered binary tree. (ii) Insert Kirk. Show the binary tree. (iii)delete John. Show the binary tree. Q.3 (a) Write an algorithm to return the value of ith element from top of the stack. (b) Write an algorithm for inserting an element in a stack, removing an element from stack. (c) Write algorithm for inserting and deleting an element in circular queue. Q.3 (a) Consider the expression v*v2-(v3+v4^v5). Show the tree corresponding to the expression. (b) What is an ordered tree? What is forest? (c) Explain the structure of indexed sequential file. Q.4 (a) Consider singly linked storage structures,write an algorithm which inserts a node into a linked linear list in a stack like manner. (b) How open addressing can be used for collision resolution? (c) Explain structure of sequential file. Explain processing in sequential file. Q.4 (a) Consider singly linked storage structures,write an algorithm which performs an insertion at the end of a linked linear list. (b) Give definitions (i) Graph (ii) Adjacent nodes (c) What is priority queue? Explain the array representation of priority queue. Q.5 (a) Explain outdegree and indegree. (b) Explain Depth First Search operation. (c) Explain the trace of selection sort on following data. 42,23,74,,65,58,94,36,99,87 Q.5 (a) Write and explain application of queue. (b) Explain Breadth First Search operation. (c) Explain the trace of bubble sort on following data. 42,23,74,,65,58,94,36,99,87 ************* 2

Seat No.: Enrolment No. GUJARAT TECHNOLOGICAL UNIVERSITY BE - SEMESTER III(New) EXAMINATION WINTER 206 Subject Code:2302 Date:02/0/207 Subject Name:Data Structure Time: 0:30 AM to 0:00 PM Total Marks: 70 Instructions:. Attempt all questions. 2. Make suitable assumptions wherever necessary. 3. Figures to the right indicate full marks. MARKS Q. Explain the following terms in brief 4 Primitive data structure 2 Non-primitive data structure 3 Linear data structure 4 Non-linear data structure 5 Recursion 6 Time complexity of an algorithm 7 Double-ended queue 8 Priority queue 9 Circular linked list 0 Complete binary tree 2-3 tree 2 Minimum spanning tree 3 Degree of vertex 4 Hash collision Q.2 (a) Write a pseudo-code for PUSH and POP operations of stack. (b) What is prefix notation? Convert the following infix expression into prefix. A + B C * D * E $ F $ G (c) Write an algorithm to perform various operations (insert, delete and display) for simple queue. (c) Write differences between simple queue and circular queue. Write an algorithm for insert and delete operations for circular queue. Q.3 (a) Convert the following infix expression into postfix. A + B C * D * E $ F $ G (b) Write algorithm(s) to perform INSERT_FIRST (to insert a node at the first position) and REVERSE_TRAVERSE (to display the data in nodes in reverse order) operations in doubly linked list. (c) Write a C program to implement stack using linked list. Q.3 (a) Enlist and briefly explain various applications of stack. (b) Discuss various rehashing techniques. (c) Write C functions to implement INSERT_FIRST (to insert a node at the first position), DELETE_FIRST (to delete a node from the first position), DELETE_LAST (delete a node from the last position) and TRAVERSE (to display the data in nodes) operations in circular linked list.

Q.4 (a) Write an algorithm for Binary search method. (b) Write a C program for Bubble sort. (c) Sort the following numbers using (i) Selection sort (ii) Quick sort: 0 50 0 20 30 0 Q.4 (a) Write a C function for Selection sort. (b) Write an algorithm for Quick sort. (c) Explain Depth First Search and Breadth First Search in graphs with an example. Q.5 (a) Draw a binary expression tree for the following and perform preorder traversal for the same: (A + B $ C) + (D + E * F) (b) Construct a binary search tree for the following and perform inorder and postorder traversals: 5 9 4 8 2 3 7 6 (c) Write C functions for: inserting a node, postorder traversal and counting total number of nodes for binary search tree. Q.5 (a) Explain AVL trees. (b) Construct a binary search tree from the following traversals: Inorder: 3 4 5 6 7 9 7 20 22 Preorder: 9 4 3 6 5 7 7 22 20 (c) Write Kruskal s algorithm for minimum spanning tree with an example. ************* 2

Seat No.: Enrolment No. GUJARAT TECHNOLOGICAL UNIVERSITY BE - SEMESTER III(New) EXAMINATION SUMMER 206 Subject Code:2302 Date:09/06/206 Subject Name:Data Structure Time:0:30 AM to 0:00 PM Total Marks: 70 Instructions:. Attempt all questions. 2. Make suitable assumptions wherever necessary. 3. Figures to the right indicate full marks. MARKS Q. Short Questions 4 Define primitive data structure. 2 Explain space and time complexity. 3 What is the time complexity of Quicksort algorithm in the worst case? 4 List the applications of Stack. 5 Define graph. 6 Explain degree of a vertex in a graph. 7 List the applications of Graphs. 8 List the applications of Binary trees. 9 Define B-Tree. 0 Describe the time complexity of Binary search algorithm. What is hash collision? 2 Write C structure of Binary tree. 3 Write C structure of Singly linked list. 4 Define priority queue. Q.2 (a) Write an algorithm for simple queue with ENQUEUE operations. (b) Write an algorithm to reverse a string using stack. (c) Write a program to implement stack using linked list. (c) Write a program to implement circular queue using array. Q.3 (a) Evaluate the following postfix expression using stack: (a) 9 3 4 * 8 + 4 / - (b) 5 6 2 + * 2 4 / - + (b) Explain the concept of circular queue. Compare circular queue with simple queue. (c) Explain insert and delete operations in AVL trees with suitable examples. Q.3 (a) Explain double ended queue. (b) Write C functions to implement DELETE_FIRST_NODE and TRAVERSE operations in doubly linked list. (c) With a suitable example, explain steps for conversion of a general tree into a binary tree. Q.4 (a) Explain Sequential search method. (b) Explain Threaded binary trees with suitable examples. (c) Write an algorithm for Selection sort method. Explain each step with an example. Q.4 (a) Explain Depth First Search in graphs with an example. (b) Explain Binary search method.

(c) Write an algorithm for Insertion sort method. Explain each step with an example. Q.5 (a) Explain Breadth First Search in graphs with an example. (b) Construct a binary tree from the traversals given below: Inorder: 3 4 6 7 8 0 3 4 Preorder: 8 3 6 4 7 0 4 3 (c) Explain various Hash collision resolution techniques with examples. Q.5 (a) Explain Sequential file organizations and list its advantages and disadvantages. (b) Draw a Binary expression tree for the following and perform preorder traversal: (A $ B $ C) + (D E * F) (c) Write Prim s algorithm for minimum spanning tree with an example. ************* 2

Seat No.: Enrolment No. GUJARAT TECHNOLOGICAL UNIVERSITY BE - SEMESTER III (New) EXAMINATION WINTER 205 Subject Code:2302 Date:02/0/206 Subject Name: Data Structures Time: 2:30pm to 5:00pm Total Marks: 70 Instructions:. Attempt all questions. 2. Make suitable assumptions wherever necessary. 3. Figures to the right indicate full marks. Q. Short Questions 4 Define data structure. 2 List operations performed on a stack. 3 Mention variations of the queue data structure. 4 What is the worst case time complexity of searching an element in a list? How? 5 Mention one operation for which use of doubly linked list is preferred over the singly linked list. 6 Write an algorithm/steps to traverse a singly linked list. 7 Define: Height of a tree. 8 What is the height of a complete binary with n nodes? 9 Write two simple hash functions. 0 What is a header node and what is its use? Is Queue a priority queue? Justify. 2 What is the complexity of binary search algorithm? 3 Name two divide and conquer algorithms for sorting. 4 Give two applications of graphs. Q.2 (a) Write an algorithm to check if an expression has balanced parenthesis using stack. (b) What is postfix notation? What are its advantages? Convert the following infix expression to postfix. A$B-C*D+E$F/G (c) Write a C program to implement a stack with all necessary overflow and underflow checks using array. (c) Write a C program to implement a circular queue using array with all necessary overflow and underflow checks. Q.3 (a) Evaluate the following postfix expression using a stack. Show the stack contents. AB*CD$-EF/G/+ A=5, B=2, C=3, D=2, E=8, F=2, G=2 (b) Perform following operations in a circular queue of length 4 and give the Front, Rear and Size of the queue after each operation. ) Insert A, B 2) Insert C 3) Delete 4) Insert D MARKS

5) Insert E 6) Insert F 7) Delete (c) Write a program to insert and delete an element after a given node in a singly linked list. Q.3 (a) Explain various applications of queue. (b) Differentiate between arrays and linked list. (c) Create a doubly circularly linked list and write a function to traverse it. Q.4 (a) Define complete binary tree and almost complete binary tree. (b) Explain deletion in an AVL tree with a suitable example. (c) What is binary tree traversal? What are the various traversal methods? Explain any two with suitable example. Q.4 (a) Mention the properties of a B-Tree. (b) Construct a binary tree from the traversals given below: Inorder:, 0,, 2, 3, 4, 5, 7, 8, 2 Postorder:,, 2, 0, 4, 8, 2, 7, 5, 3 (c) What is a binary search tree? Create a binary search tree for inserting the following data. 50, 45, 00, 25, 49, 20, 05, 46, 90, 95 Explain deletion in the above tree. Q.5 (a) Insert the following elements in a B-Tree. a, g, f, b, k, c, h, n, j (b) Apply quicksort algorithm to sort the following data. Justify the steps. 42, 29, 74,, 65, 58 (c) What is hashing? What are the qualities of a good hash function? Explain any two hash functions in detail. Q.5 (a) List advantages and disadvantages of Breadth First Search and Depth First Search. (b) What is a minimum spanning tree? Explain Kruskal s algorithm for finding a minimum spanning tree. (c) Discuss various methods to resolve hash collision with suitable examples. ************* 2

Seat No.: Enrolment No. GUJARAT TECHNOLOGICAL UNIVERSITY BE - SEMESTER III (NEW) EXAMINATION SUMMER 205 Subject Code: 2302 Date:09/06/205 Subject Name: DATA STRUCTURE Time: 02.30pm-05.00pm Total Marks: 70 Instructions:. Attempt all questions. 2. Make suitable assumptions wherever necessary. 3. Figures to the right indicate full marks. Q. (a) Write a C program for insertion sort and discuss its efficiency. (b) Briefly explain various linear and non-linear data structures along with their applications. Q.2 (a) Write C functions to: () insert a node at the end (2) delete a node from the beginning of a doubly linked list. (b) Write an algorithm to reverse a string of characters using stack. (b) Compare: () Linked-list and Array (2) Circular queue and Simple Queue. Q.3 (a) Convert (A + B) * C D ^ E ^ (F * G) infix expression into prefix format showing stack status after every step in tabular form. (b) Write an algorithm to implement insert and delete operations in a simple queue. Q.3 (a) Describe: () Recursion (2) Priority Queue (3) Tower of Hanoi (b) Write a C functions to: () insert a node at beginning in singly linked list (2) insert an element in circular queue. Q.4 (a) With figure, explain the following terms: () Depth of a tree (2) Sibling nodes (3) Strictly binary tree (4) Ancestor nodes (5) Graph (6) Minimum spanning tree (7) Degree of a vertex (b) Generate a binary search tree for following numbers and perform in-order and post-order traversals: 50, 40, 80, 20, 0, 30, 0, 90, 60, 70 Q.4 (a) Explain Right-in-threaded, left-in-threaded and full-in-threaded binary trees. (b) Write Kruskal s algorithm for minimum spanning tree and explain with an example. Q.5 (a) Describe various collision resolution techniques in hashing. (b) Write an algorithm for binary search method and discuss its efficiency. Q.5 (a) Explain Sequential, Indexed Sequential and Random file organizations. (b) Write recursive C functions for () in-order (2) pre-order and (3) post-order traversals of binary search tree. *************

Seat No.: Enrolment No. GUJARAT TECHNOLOGICAL UNIVERSITY BE - SEMESTER III EXAMINATION WINTER 204 Subject Code: 2302 Date: 0-0-205 Subject Name: Data Structure Time: 02.30 pm - 05.00 pm Total Marks: 70 Instructions:. Attempt all questions. 2. Make suitable assumptions wherever necessary. 3. Figures to the right indicate full marks. Q. (a) Write short note on performance analysis and performance measurement of an algorithm. (b) Write a selection sort algorithm and also discuss its efficiency. Q.2 (a) What is Stack? List out different operation of it and write algorithm for any two operation. (b) Write a 'C' program or an algorithm to convert infix expression without parenthesis to postfix expression. (b) Write user defined C function for inserting an element into circular queue. Q.3 (a) What is a Queue? Write down drawback of simple queue. Also write an algorithm for deleting an element from circular queue (b) Write down advantages of linked list over array and explain it in detail. Q.3 (a) Write an algorithm to delete a node from doubly linked list. (b) Convert A+(B*C-(D/E^F)*G) infix expression into postfix format showing stack status after every step in tabular form. Q.4 (a) Define the following terms. ) Graph 2) Tree 3) Multi graph 4) Weighted graph 5) Elementary path 6) Complete Binary tree 7) Descendent node (b) List out different traversal way of tree and demonstrate any two with example. Q.4 (a) Write an algorithm to delete a node from tree. (b) Explain BFS and DFS in detail. Q.5 (a) Explain AVL tree with example. (b) List out different hash methods and explain any three. Q.5 (a) Write down precondition and algorithm of binary search method. (b) Explain file in terms of fields, records and database. *************

Seat No.: Enrolment No. GUJARAT TECHNOLOGICAL UNIVERSITY BE - SEMESTER III (OLD) - EXAMINATION SUMMER 207 Subject Code: 302 Date: 02/06/207 Subject Name: Data and File Structure Time: 0:30 AM to 0:00 PM Total Marks: 70 Instructions:. Attempt all questions. 2. Make suitable assumptions wherever necessary. 3. Figures to the right indicate full marks. Q. (a) What does abstract data type means? Briefly explain linear and non linear data structures. (b) Explain PUSH and POP operation of the stack with algorithm. Q.2 (a) Convert following infix expressions to the postfix expressions. Shows stack trace. A/B$C+D*E/F-G+H (A+B)*D+E/(F+G*D)+C (b) Write an algorithm to convert infix to postfix expression and explain it with example. (b) Write a Program to perform insert and delete operations on a circular Queue. Q.3 (a) Define recursion. What care should be taken in writing recursive function? Give a recursive solution for the problem of Towers of Hanoi. (b) Write an algorithm to insert and delete a node in Doubly Linked List. Q.3 (a) Differentiate between stack & queue. Also explain priority queue with example. (b) Write a program to search an element in a linked list. Q.4 (a) Create a Binary Search Tree for the following data and do in-order, Preorder and Post-order traversal of the tree. 40, 60, 5, 4, 30, 70, 65, 0, 95, 25, 34 (b) Define the following with example : Strictly binary tree Complete binary tree Q.4 (a) How graph can be represented? Write an algorithm for Breadth First Search Traversal of a Graph. (b) What is an AVL tree? Explain the different types of rotations used to create an AVL tree with suitable examples. Q.5 (a) What is hashing? Explain hashing functions. (b) Write a short note on inverted key file organization Q.5 (a) Define Hash Clash. Explain Primary Clustering, secondary clustering, rehashing and double hashing. (b) Write a short note on indexed file organization. *************

Seat No.: Enrolment No. GUJARAT TECHNOLOGICAL UNIVERSITY BE - SEMESTER III(OLD) EXAMINATION WINTER 206 Subject Code:302 Date:/0/207 Subject Name:Data and File Structure Time: 0:30 AM to 0:00 PM Total Marks: 70 Instructions:. Attempt all questions. 2. Make suitable assumptions wherever necessary. 3. Figures to the right indicate full marks. Q. (a) What is data structure? Explain different types of data structures with applications. (b) Derive the formula to calculate address A[i, j] of 2-D array, for a Row-major order storage representation. A 2-D array defined as A[r, c] where r 4, 5 c 8, requires 2 bytes of memory for each element. If the array is stored in Row-major order form, calculate the address of A[3,7] given the Base address as 2000. Q.2 (a) Discuss and compare array and linked list. (b) Discuss importance of hashing. Also discuss one of the method of hashing with an example. (b) Discuss the structure of sequential and indexed file organization. Q.3 (a) Write algorithm code for PUSH, POP and DISPLAY function of the STACK. (b) Convert the following infix expression to postfix form using Stack. (( A (B + C)) D) / (E + F) Q.3 (a) Write algorithm code for INSERT, DELETE and DISPLAY function of the QUEUE. (b) What is a priority queue? Discuss the array implementation of priority queue. Q.4 (a) Write C code to insert a node at the end of a doubly link list. (b) Write an algorithm to merge two simple link lists having initial address L and L2 respectively. Also write algorithm to display the list. Q.4 (a) Write algorithm code for DELETE and DISPLAY functions of Circular Link List. (b) Write C code for the following operations for a simple link list. i. Reverse : to reverse the link list ii. Max : to find the largest element from the link list. Q.5 (a) Write a non-recursive algorithm for Preorder traversal of a binary tree (b) What is a sparse matrix? Explain memory representation of a sparse matrix. Q.5 (a) Discuss DFS and BFS. (b) Discuss Inorder and Postorder traversal of a binary tree. *************

Seat No.: Enrolment No. GUJARAT TECHNOLOGICAL UNIVERSITY BE - SEMESTER III EXAMINATION SUMMER 206 Subject Code:302 Date:09/06/206 Subject Name:Data and File Structure Time:0:30 AM to 0:00 PM Total Marks: 70 Instructions:. Attempt all questions. 2. Make suitable assumptions wherever necessary. 3. Figures to the right indicate full marks. Q. (a) Give various applications of stack and queue. 06 (b) What is a binary search tree? Explain with an example and state its applications. Also explain deletion in a binary search tree. 05 (c) Discuss the advantages and disadvantages of linked list over array. Q.2 (a) Write a C program to implement a stack. Do check for overflow and underflow. (b) What is hashing? Explain the collision resolution techniques. (b) Define recursion. What care should be taken in writing recursive function? Give a recursive solution for the problem of Towers of Hanoi. Q.3 (a) Consider a circular queue of size 6. Let Front =2, Rear =4, and Queue :, L, M, N,, Describe the queue as following operations are performed. ) Add O 2) Add P 3) Delete 4) Delete 5) Add Q, R, S 6) Delete (b) What is importance of postfix notation? Write the algorithm for converting an infix expression to postfix notation. Q.3 (a) Convert the following expression to postfix notation. Show the contents of the stack while conversion. 2 / (7-3) + 2 * ( + 5) (b) What is a priority queue? Discuss the array implementation of priority queue. Q.4 (a) Write an algorithm to insert a node before a given node in a singly linked list. Is it advantageous to use a doubly linked list for this operation? Explain. (b) Create a B-tree of order 5 by inserting the following data values. D, H, K, Z, B, P, Q, E, A, S, W, T, C, L, N, Y, M Q.4 (a) What is an AVL tree? Explain the different types of rotations used to create an AVL tree with suitable examples. (b) Construct an expression tree for the following expression. A+(B+C*D+E)+F/G. Make a preorder traversal of the resultant tree.

Q.5 (a) A binary tree T has 9 nodes. The inorder and preorder traversals of T give the following sequence of nodes. Inorder: E A C K F H D B G Preorder: F A E K C D H G B Draw the tree T. (b) What is a graph? Discuss the Adjacency Matrix and Adjacency List representation of graphs with an example. Q.5 (a) Define the following with respect to a graph: ) Path 2) degree 3) Cycle 4) Spanning tree 5) Directed Graph (b) Consider the following graph: Create a minimum spanning tree using the Kruskal s algorithm. A B C D E F G H ************* 2

Seat No.: Enrolment No. GUJARAT TECHNOLOGICAL UNIVERSITY BE - SEMESTER III EXAMINATION WINTER 205 Subject Code:302 Date:02/0/206 Subject Name: Data and File Structure Time: 2:30pm to 5:00pm Total Marks: 70 Instructions:. Attempt all questions. 2. Make suitable assumptions wherever necessary. 3. Figures to the right indicate full marks. Q. (a) What does abstract data type means? Briefly explain linear and non linear data structures. (b) Given a two dimensional array A(:8, 7:4) stored in row-major order with base address 00 and size of each element is 4 bytes, find address of the element A(4, 2). Q.2 (a) Write an algorithm to implement PUSH and POP Operations on Stack. (b) Write an algorithm for evaluation of postfix expression and evaluate the following expression showing every status of stack in tabular form. 5 6 2 - * 4 9 3 / + * (b) Enlist difference between recursive and iterative algorithms. Write any one recursive function showing the stack contents while function call and return. Q.3 (a) Write a program to perform insert and delete routines on a queue. (b) Write advantages and disadvantages of linked list, doubly linked list and circular linked list with example. Q.3 (a) Explain priority queue and dequeue. Write an algorithm/program for insert routine in input restricted dequeues. (b) Write a program to search an element in a linked list. Q.4 (a) Create a Binary Search Tree for the following data and do in-order, Preorder and Post-order traversal of the tree. 40, 60, 5, 4, 30, 70, 65, 0, 95, 25, 34 (b) Define the following with example : Strictly binary tree Complete binary tree Q.4 (a) What is Binary Search Tree? Write recursive algorithm/program to implement in-order traversal of the Binary Search Tree.

(b) Define height balanced tree. Construct a height balanced binary tree (AVL tree) for the following data 32,6,44,52,78,40,2,22,02,23 Q.5 (a) What is hashing? Briefly explain various methods of hashing. (b) Explain with example DFS and BFS traversal of graph. Q.5 (a) What is File Structure? Explain any one File Structure in detail. (b) Show how graph can be represented using example? How path matrix can be found out using adjacency matrix. ************* 2

Seat No.: Enrolment No. GUJARAT TECHNOLOGICAL UNIVERSITY BE SEMESTER III EXAMINATION SUMMER 205 Subject Code:302 Date:09/06/205 Subject Name: Data and File structure Time: 02.30pm-05.00pm Total Marks: 70 Instructions:. Attempt all questions. 2. Make suitable assumptions wherever necessary. 3. Figures to the right indicate full marks. Q. (a) (b) (i) Write algorithm to sum values in vector V and find out the execution time required. (ii) Explain the equation that finds out the address of the element of the one dimensional array. Assume necessary data. (i) Convert the following Polish(prefix) expression to Reverse Polish(suffix) notation a. ++abc b. +a+bc c. +a*bc d. *a+bc (ii) Does a time sharing computer use a queue or stack? Explain. Q.2 (a) Write an algorithm for inserting a node and deleting a node in doubly linked linear list. (b) Write steps of procedure to insert an element to the top of the stack and remove top element from a stack. (b) What is the advantage of Polish expression over infix notation? Write an algorithm to convert an infix expression into reverse Polish expression. Q.3 (a) (b) (i) Write a recursive algorithm to find factorial. (ii) Which type of allocation is called linked allocation? Define singly linked linear list. (i) Explain the threaded storage representation for binary trees. (ii) Define the inorder, postorder and preorder traversal for the following tree. A B D C E G F Q.3 (a) (i) What are the advantages of circular lists over singly linked list? (ii) Explain Why doubly linked lists are much more efficient with respect to deletions than singly linked lists?

(b) (i) Define adjacency matrix. When two digraphs are considered to be equivalent? (ii) Explain the breadth first search and depth first search tree traversal on the following graph. A B C D E F Q.4 (a) Write an algorithm for inserting and deleting an element from queue. (b) (i) Define 2-3 tree. Describe the characteristic of 2-3 tree. (ii) Write the characteristics of AVL tree. Q.4 (a) What is a circular queue? Write an algorithm for inserting and deleting an element from a circular queue. (b) (i) Explain the structure of sequential file. (ii) Explain the structure of indexed sequential files. Q.5 (a) What is collision? Explain two broad classes of collision resolution techniques. (b) Explain the binary search method. Write an algorithm for performing a binary search. Q.5 (a) What is hashing? Explain hashing functions. (b) Explain the multi key file organization and access methods. ************* 2

Seat No.: Enrolment No. GUJARAT TECHNOLOGICAL UNIVERSITY BE - SEMESTER III EXAMINATION WINTER 204 Subject Code: 302 Date: 0-0-205 Subject Name: Data and File Structure Time: 02.30 pm - 05.00 pm Total Marks: 70 Instructions:. Attempt all questions. 2. Make suitable assumptions wherever necessary. 3. Figures to the right indicate full marks. Q. (a) What is data structure? Explain linear and non-linear data structure with example. (b) Discuss best case, average case and worst case time analysis with example. (c) Explain PUSH and POP operation of the stack with algorithm. Q.2 (a) Write an algorithm to perform insert and delete operation on single queue. (b) (a) Convert the following infix expression to postfix prefix form. (( A ( B +C))* D) $ ( E +F ) (b) Evaluate the following infix expression. 2 $ 3 + 5 * 2 $ 2 6 / 6 (b) Define the following term : Path, Cycle, Degree of vertex, Sibling, Height Balanced Tree, Strictly binary tree, in degree Q.3 (a) Explain delete operation in doubly link list. (b) What is the difference between queue & Dqueue. Explain insertion operation in Dqueue. Q.3 (a) Write an algorithm to reverse a given single link list. (b) Create a binary search tree by inserting following nodes in sequence. 68,85,23,38,44,80,30,08,26,5,92,60 Write inorder,preorder and post order traversal of the above generated Binary search tree. Q.4 (a) Write an algorithm to perform traversal of Binary search tree (b) Explain AVL tree with the help of an example also show insertion and deletion with the help of an example. (a) Write a short note on :spanning tree, threaded binary tree (b) Explain the basic two techniques for Collision-resolution in Hashing with example. Also explain primary clustering. Q.5 (a) Compare and contrast Prim s and Kruskal s algorithm with the help of an example (b) Explain various multiple key access file organization in brief with advantages and disadvantages of each method. Q.5 (a) What do you mean by Hashing? Explain any FOUR hashing techniques (b) Explain and differentiate BFS and DFS graph traversal method with suitable graph. *************

Seat No.: Enrolment No. GUJARAT TECHNOLOGICAL UNIVERSITY BE - SEMESTER III EXAMINATION SUMMER 204 Subject Code: 302 Date: -06-204 Subject Name: Data and File Structure Time: 02.30 pm - 05.00 pm Total Marks: 70 Instructions:. Attempt all questions. 2. Make suitable assumptions wherever necessary. 3. Figures to the right indicate full marks. Q. (a) Answer the following i) Obtain the expression tree from the following post fix representation ab+cde+** ii) Define complete binary tree and a full binary tree iii) List the features of a good hash function iv) List the uses of stack, queue and linklists v) What are priority queues? Explain it s uses (b) Evaluate the following postfix expression using stack AB+CD/*GH*+ ((where A=2,B=4,C=6,D=3,G=8,H=7) Q.2 (a) Write an algorithm to convert infix to postfix expression and explain it with example (b) Translate the following string into polish notation and trace the content of stack A - ( B / C + (D % E * F) / G ) * H (b) i) Consider a dequeue given below which has LEFT=, RIGHT=5 _ A B C D E. Now perform the following operations on the dequeue. Add F on the left. 2. Add G on the right. 3. Add H on the right. 4. Delete two alphabets from left 5. Add I on the right ii) Differentiate peep() and pop() functions Q.3 (a) Write a program in any programming language to concatenate two doubly linked lists. (b) Write an algorithm to insert a node in an ordered linked list Q.3 (a) Give the preorder and Inorder traversal of the tree given in fig. (b) Given the following traversals create a binary tree from that. Also give the postorder traversal for the same. preorder = {7,0,4,3,,2,8,} inorder = {4,0,3,,7,,8,2} Q.4 (a) Explain DFS and BFS with example (b) Construct a binary search tree for the following sequence. Also do the inorder and postorder traversal for the same 45,56,39,2,34,78,54,67,0,32,89,8 Q.4 (a) What is a spanning tree? Find the minimum spanning tree for the graph shown in fig 2. 0

(b) Write short notes on (i) Height Balanced Tree. (ii) Indexed-Sequential Files Q.5 (a) What do you mean by Hashing? Explain any FOUR hashing techniques (b) Define the following terms i) Node ii) Sibling iii) Path iv) Indegree & outdegree of a vertex v) Connected graph Q.5 (a) Compare and contrast Prim s and Kruskal s algorithm with the help of an example (b) Explain AVL tree with the help of an example also show insertion and deletion with the help of an example. Fig:. Fig :2 ************* 2

Seat No.: Enrolment No. GUJARAT TECHNOLOGICAL UNIVERSITY BE - SEMESTER III EXAMINATION WINTER 2 Subject Code: 302 Date: -2-2 Subject Name: Data and File Structure Time: 02.30 pm - 05.00 pm Total Marks: 70 Instructions:. Attempt all questions. 2. Make suitable assumptions wherever necessary. 3. Figures to the right indicate full marks. Q. Answer the following. 4 (a) What do you mean by Data Structure? Give the difference between Primitive and Non-primitive data structures. (b) Explain Multidimensional Array. How it is stored in memory? (c) Write a short note on threaded binary tree (d) Convert following Infix expression into Postfix expression. Show each step. A + B ^ C^ D - E * F / G Q.2 (a) What is Stack? Write down algorithms for performing POP and PEEP operations on a stack. (b) Answer the following. (i) Compare Simple Queue and Circular Queue. (ii) Define the following terms: Path, Cycle, Degree of vertex, Sibling. (b) Write an algorithm to implement insert and delete operation into a Circular Queue using array representation of Queue. Q.3 Answer the following.(any TWO) 4 (a) Write an algorithm/program to Delete a node from Doubly Linked List. (b) Write an algorithm/program to Insert a node at End operation of Singly Linked List. (c) Define tree. Write an algorithm to do in-order traversal and post-order traversals of Binary Search Tree. Q.4 Answer the following.(any TWO) 4 (a) Create a Binary Search Tree for the following data and do Inorder, Preorder and Postorder traversal of the tree. 40, 65,25, 55, 0,70,30,50,5,80,75 (b) Define Graph. Write an algorithm to do BFS traversal of a Graph. (c) Write short notes on (i) Height Balanced Tree. (ii) Indexed-Sequential Files. Q.5 Answer the following.(any TWO) (a) Explain matrix and linked list representation of a Graph. Also compare BFS and DFS methods of Graph Traversal. (b) What do you mean by Hashing? Explain any FOUR hashing techniques. (c) Explain various multiple key access file organization in brief with advantages and disadvantages of each method. ************* 4

2

Seat No.: Enrolment No. GUJARAT TECHNOLOGICAL UNIVERSITY BE - SEMESTER III EXAMINATION SUMMER 2 Subject Code: 302 Date: -06-2 Subject Name: Data and File Structure Time: 02.30 pm - 05.00 pm Total Marks: 70 Instructions:. Attempt all questions. 2. Make suitable assumptions wherever necessary. 3. Figures to the right indicate full marks. Q. (a) Define sparse matrix. Briefly explain representation of sparse matrix with the help of link list and array. (b) Define data structure. Briefly explain linear and non linear data structures with their applications Q.2 (a) Convert following infix expressions to the postfix expressions. Shows stack trace. A/B$C+D*E/F-G+H (A+B)*D+E/(F+G*D)+C (b) Write an algorithm for stack operations Push, Pop and Empty. Assume stack is implemented using array (b) What is the advantage of postfix expression over infix expression? Write an algorithm of postfix expression evaluation. Q.3 (a) Write a C function search (l, x) that accepts a pointer l to a list of integers and returns a pointer to a node containing x if it exists and the null pointer otherwise. (b) Write insert and remove functions for queue if it is implemented using circular link list. Q.3 (a) Briefly explain advantages of doubly link list over singly link list. Write function delete (p, &x) which delete the node pointed by p in doubly link list. (b) Briefly explain advantages of binary search tree. Construct binary search tree for the following elements 8,3,,5,9,2,3,4,6,20 Q.4 (a) The inorder and preorder traversal of a binary tree are d b e a f c g a b d e c f g respectively Construct binary tree and find its postorder traversal. (b) Define Directed graph, spanning tree and minimum spanning tree. Find minimum spanning tree for the graph shown in Figure. Q.4 (a) Answer the following. The height of a binary tree is the maximum number of edges in any root to leaf path. Define the maximum number of nodes in a binary tree of height h. 0 2. Consider a B-tree in which the maximum number of keys in a node is /2

5. What is the minimum number of keys in any non-root node? 3. Define threaded binary tree. What are the advantages of threaded binary tree? Give example of threaded binary tree. (b) The Breadth First Search algorithm has been implemented using the queue data structure. Find breadth first search for the graph shown in Figure 2 with starting node M Q.5 (a) The keys 2, 8, 3, 2, 3, 23, 5 and 5 are inserted into an initially empty hash table of length 0 using open addressing with hash function h(k) = k mod 0 and linear probing. What is the resultant hash table? (b) Define AVL tree. Construct AVL tree for following data 0,20,30,40,50,60,70,80 Q.5 (a) What are the advantages of Multi way search tree over binary search tree? Construct 2-3 tree for the following data 2, 50, 85, 6, 0, 37, 00, 20, 25, 70 (b) Define following. Strictly binary tree 2. Index sequential search 3. Hashing 0 05 ************* Figure Figure 2 2/2