EE DATA STRUCTURES AND ALGORITHMS TWO MARK QUESTIONS WITH ANSWERS ANNA UNIVERSITY QUESTION BANK. Sign in. Main menu. EE Data Structures and Algorithms – 2 MARKS. Instructions: 1. CLICK HERE to view the document online. 2. CLICK HERE to Download. EE DATA STRUCTURES AND ALGORITHM (Common to EEE, EIE & ICE) UNIT I LINEAR STRUCTURES Abstract Data Types (ADT) List ADT array-based .
|Published (Last):||25 October 2014|
|PDF File Size:||16.71 Mb|
|ePub File Size:||10.17 Mb|
|Price:||Free* [*Free Regsitration Required]|
Each module is a logical unit and does a specific job modules which in turn will call another module. Modularity has several advantages 1. Modules can be compiled separately which makes debugging process easier.
Several modules can be implemented and executed simultaneously. Modules can be easily enhanced. Abstract Data type is an extension of modular design.
An abstract data type is a set of operations such as Union, Intersection, Complement, Find etc. The general form of the list is A 1, A 2, A 3, Various operations performed on List. Find X – Returns the position of X. Next i – Returns the position of its successor element i Previous i – Returns the position of its predecessor i Print list – Contents of the list is displayed. Linked List Sgructures 3.
Array Implementation of List Array is a collection of specific number of data stored in a consecutive memory locations. Linked List Implementation Linked list consists of series of nodes. Each node contains the element and a pointer to its successor node. The pointer algorith,s the last node points to NULL. Insertion and deletion operations are easily performed using linked list. Types of Linked List 1. Singly Linked List algoritums. Circular Linked List Singly Linked List A singly linked list is a linked list in which each node contains only one link field pointing to the next node in the list.
Circular linked list can structured implemented as Singly linked list and Doubly linked list with or without headers. Singly Linked Circular List A singly linked circular list is a linked list in which the last node of the list points to the first node.
EE DATA STRUCTURES AND ALGORITHM (Common to EEE, EIE & ICE) – PDF
Doubly Linked Circular List A doubly linked circular list is a Doubly linked list in which the forward link of the last node points to the first node and backward link of the first node points to the last node of the list.
Advantages of Circular Linked List It allows to traverse the list starting at any point. It allows quick access to the first and last records. Multilist Polynomial ADT We can perform the polynomial manipulations such as addition, subtraction and differentiation etc. It can be performed using buckets from 0 to 9. In First Pass, all the elements are sorted according to the least significant bit.
In second pass, the numbers are arranged according to the next least significant bit and so on this process is repeated until it reaches the most significant bits of all numbers.
The numbers of passes in a Radix Sort depends upon the number of digits in the numbers given. A stack is a linear data structure which follows Last In First Out LIFO principle, in which both insertion and deletion occur at only one end of the list called the Top. The process of inserting a new element to the top of the stack.
EEData Structures and Algorithms
For every push operation the top is incremented by 1. The process of deleting an element from the top of stack is called pop operation. After every pop operation the top pointer is decremented by 1. Array Implementation In this implementation each stack is associated with a pop pointer, which is -1 for an empty stack. To pop an element, the stack [Top] value is returned and the top pointer is decremented. IsEmpty s return S[Top]. Pop operation is performed by deleting at the front of the list.
Top operation returns the element at the front of the list. IsEmpty s pop s. Also called reverse polish notation. Also called as polish notation. Evaluating Arithmetic Expression To evaluate an arithmetic expressions, first convert the given infix expression algorirhms postfix expression and then evaluate the postfix expression using stack. If the character is an operand, place it on to the output. If the character is an operator, push it onto the stack. If the stack operator has a higher or equal priority than input operator then pop that operator from the stack and place it onto the output.
If the character is a left paraenthesis, push it onto the stack. If the character is a right paraenthesis, pop all the operators from the stack till it encounters left parenthesis, discard both the parenthesis in the output.
Recursive Solution N – represents the number of structurew. Then repeat the step 2 to move 2 disks from B to C using A as intermediate. In general, to move N disks. Apply the recursive technique to move N – 1 disks from A to B using C as an intermediate. Then move the N th disk from A to C.
EE2204 DATA STRUCTURES AND ALGORITHM (Common to EEE, EIE & ICE)
Then again apply the recursive technique to move N – 1 disks from B to C using A as an intermediate. Similarly the a,gorithms location address in the routine must be saved so that the new function knows where to go after it is completed.
The process of deleting an element from the queue.
Attempt to insert an element, when the queue is full is said to be overflow condition. Attempt to delete an element from the queue, when the queue is empty is said to be underflow Implementation of Queue Queue can be implemented using arrays and pointers. Array Implementation In this structuree queue Q is associated with two pointers namely rear pointer and front pointer.
Dequeue operation is performed at the front of the list. Advantages It overcomes the problem of unutilized space in abd queues, when it is implemented as arrays.
What are the advantages of linked list over arrays? What qnd the advantages of doubly linked list over singly linked list? List the applications of List ADT.
Write a procedure for polynomial differentiation. What are the operations performed on stack and write its exceptional condition? What do you mean by cursor implementation of list? List the application of stack 9.
Write the recursive routine to perform factorial of a given number. Define Queue data structure and give some applications for it. What is Circular Queue?
What is Priority Queue? Write a routine to return the top element of stack. Write a routine to check IsEmpty and Islast for queue. Write a procedure to insert an element in a singly linked list.
What is the principle of radix sort? Part – B 1. Explain the array and linked list implementation of stack. Explain the array and linked list implementation of Queue. What are the various linked list operations? Explain how stack is applied for evaluating an arithemetic expression. Write the recursive routine for Towers of Hanoi. Explain Cursor implementation of List? Write the operations performed on singly linked list?
Write the insertion and deletion routine for doubly linked list? Write the procedure for polynomial addition and differentiation? A tree is a finite set of one or more nodes such that there is a specially designated node called the Root, and zero or more non empty sub trees T 1, T T k, each of whose roots are connected by a directed edge from Root R. The ADT tree A tree is a finite set of elements or nodes. If the set is non-empty, one of the nodes is distinguished as the root node, while the remaining possibly empty set of nodes are grouped into subsets, each of which is itself a tree.
This hierarchical relationship is described by referring to each such subtree as a child of the root, while the root is referred to as the parent of each subtree. If a tree consists of a single node, that node is called a leaf node.
It is a notational convenience to allow an empty tree. It is usual to represent a tree using a picture such as Fig. The subtrees rooted at a given node are eee2204 to be ordered, so the tree in Fig. Thus it makes adta to say that the first subtree at A has 4 leaf nodes.
We can represent a tree as a list consisting of the root and a list of the subtrees in order. Thus the list-based representation of the tree in Fig 3.