Você está na página 1de 3

GRT GROUP OF EDUCATIONAL INSTITUTIONS GRT INSTITUTE OF ENGINEERING AND TECHNOLOGY

UNIT TEST I-SET B(ANSWER KEY) DEPT/YEAR/SEM: ECE/II/ III SUB CODE/NAME: EC2202/DATA STRUCTURES AND OOPS IN C++ PART-A (9*2=18) 1. What is meant by an abstract data type? o An ADT is a mathematical model with a collection of operations defined on that model. 2. Difference between Arrays and Linked List? Array: i.Memory fixed size ii.Insertions ,Deletions operations are expensive Linked list: i.Requires pointers ii.Insertions ,Deletions operations are inexpensive 3. Define a stack? Stack is an ordered collection of elements in which insertions and deletions are restricted to one end 4. Define Circular queue& priority queue. A circular queue allows the queue to wrap around upon reaching the end of the array 5. What are the postfix and prefix forms of the expression? A+B*(C-D)/(P-R) A+B*(C-D)/(P-R) Postfix form: ABCD-*PR-/+ Prefix form: +A/*B-CD-PR 6. What is meant by list ADT? List ADT is a sequential storage structure. General list of the form a1, a2, a3.., an and the size of the list is n 7. Define hash function? Hash function takes an identifier and computes the address of that identifier in the hash table using some function. 8. What is a balance factor in AVL trees? Balance factor of a node is defined to be the difference between the height of the node's left subtree and the height of the node's right subtree. 9. Define BST &write the operations of BST. Key value>left subtree Key value<Right subtree DATE:02/08/12

Operations: Make empty() Find() Findmax() Findmin() Insertion() Deletion() PART-B(2*16=32) 10(a) i. Explain the linked list implementation of list ADT in Detail?(10) a. Definition for linked list b. Figure for linked list c. Next pointer d. Header or dummy node e. various operations f. Explanation g. Example figure h. Coding ii. Explain the various applications of linked list?(6) a. Polynomial ADT i.Operations ii.Coding iii. Figure b. Radix Sort i. Explanation ii.Example c. Multilist i.Explanation ii.Example figure (or) (b) i. Explain the linked list implementation of stack ADT in detail?(8) i) Definition of stack (2) ii) Explanation of ADT (2) iii)Example(6) iv)Explanation(6)

ii.Explain the array implementation of queue ADT in detail?(8) i) Definition of queue (2) ii) Algorithm for insertion and example(7) iii)Algorithm for deletionand example(7) 11(a) i. Explain the collision resolution strategies with an Example.(8) 1. Separate chaining with example(3) Open addressing with example(3) Extendible hashing with example(2) ii. Explain the various applications of stackADT. (8) Infix, Prefix & Postfix expression. 2. Conversion of infix to postfix expression. 3. Evaluating postfix expression. 4. Balancing symbols. 5. 5. Tower of Hanoi. (or) (b). Define binary search tree? Explain the various operations with an example?(16) i. Key value>left subtree ii.Key value<Right subtree Operations: Make empty() Find() Findmax() Findmin() Insertion() Deletion()

Você também pode gostar