0 Bewertungen0% fanden dieses Dokument nützlich (0 Abstimmungen)
97 Ansichten4 Seiten
The document outlines 15 lab exercises to implement various data structures and algorithms. The exercises involve implementing operations for linked lists, stacks, queues, trees, sorting algorithms and graphs. The linked list exercises include implementing basic operations as well as using linked lists to implement other data structures like stacks and queues. Tree exercises include binary search trees and expression trees. Later exercises involve analyzing sorting algorithms and implementing graph operations using an adjacency matrix.
The document outlines 15 lab exercises to implement various data structures and algorithms. The exercises involve implementing operations for linked lists, stacks, queues, trees, sorting algorithms and graphs. The linked list exercises include implementing basic operations as well as using linked lists to implement other data structures like stacks and queues. Tree exercises include binary search trees and expression trees. Later exercises involve analyzing sorting algorithms and implementing graph operations using an adjacency matrix.
The document outlines 15 lab exercises to implement various data structures and algorithms. The exercises involve implementing operations for linked lists, stacks, queues, trees, sorting algorithms and graphs. The linked list exercises include implementing basic operations as well as using linked lists to implement other data structures like stacks and queues. Tree exercises include binary search trees and expression trees. Later exercises involve analyzing sorting algorithms and implementing graph operations using an adjacency matrix.
Lab Exercise 1: (2 Hrs.) Implement the data structure Doubly Linked List. Provide C functions for the following operations: Append: adds a node at the end of the list Get by data (A variation of traverse): searches for a data value in the list Get by position: returns pointer to ith node of the list (based upon sequence)
Lab Exercise 2: (2 Hrs.)
Implement the following operations for a doubly linked list (the following functions may use the functions define in lab exercise 1): addAtPosition: adds a node at a specified position in the linked list addInAscendingOrder: ads a node on basis of data value in ascending order
Lab Exercise 3: (2 Hrs.)
Implement the following operations for a doubly linked list (the following functions may use the functions define in lab exercise 1): deleteByPosition: deletes a node from a specified position in the linked list deleteByDataValue: Delete the node containing a data value
Lab Exercise 4a: (2 Hrs.)
Use your library for linked list to implement a Linked Stack. Provide the following operations for the stack: init isEmpty isFull push pop peek
Lab Exercise 4b: (2 Hrs.)
Use your library for linked list to implement a Linked Queue. Provide the following operations for the Queue: init isEmpty isFull enqueue dequeue Practical List for File Batch: 2012-15 Subject: Data Structures
Lab Exercise 5: (2 Hrs.)
Implement the following operations on a polynomial using linked list: addTerm display evaluate
Lab Exercise 6: (2 Hrs.)
Implement the add operations on two polynomials.
Lab Exercise 7: (2 Hrs.)
Implement the following operations for a static stack (implemented using arrays): 1. init 2. isEmpty 3. isFull 4. push 5. pop 6. peek
Lab Exercise 8: (2 Hrs.)
Implement the following operations for a static queue (implemented using arrays): 1. init 2. isEmpty 3. isFull 4. enqueue 5. dequeue
Lab Exercise 9: (2 Hrs)
Implement the following operations using stacks (1,2class + 3,4home) 1. Convert an expression from infix to postfix 2. Evaluate a postfix expression 3. Convert an expression from infix to prefix 4. Evaluate a prefix expression
Lab Exercise 10: (2 Hrs)
Implement the following operations on a BST: 1. Add a node 2. Delete a node 3. Search for a key 4. Print the keys in (use recursion): a. Pre-order Practical List for File Batch: 2012-15 Subject: Data Structures b. In-order c. Post-order
Lab Exercise 11: (1 Hrs)
Implement the following operations on a BST: 1. Find the height of the tree 2. Count the number of nodes in the tree 3. Count the number of leaves in the tree 4. Clone the tree 5. Destroy the tree
Lab Exercise 12: (2 Hrs.)
Implement the following: 1. Build an expression tree from an expression give in postfix form 2. Generate the expression in the following notations a. Infix (remember to add parenthesis) b. Prefix c. Postfix 3. Evaluate the expression
Lab Exercise 13: (2 Hrs.)
Implement the following: 1. Add a node to a Right in-threaded tree. 2. Traverse the tree non-recursively in in-order
Lab Exercise 14: (6 Hrs)
Implement and compare the running time of following algorithms for a large data set: a. Bubble Sort b. Selection Sort c. Insertion Sort d. Shell Sort e. Heap Sort f. Radix Sort g. Merge Sort h. Quick Sort
Lab Exercise 15: (6 Hrs)
Provide the following operations for a graph using the adjacency matrix representation: (i) Add a Vertex (ii) Add an Edge (iii) Remove a Vertex Practical List for File Batch: 2012-15 Subject: Data Structures (iv) Remove an Edge (v) Generate Adjacency List for a given node (vi) Calculate in-degree (vii) Calculate out-degree (viii) DFS Traversal (ix) BFS Traversal