0 valutazioniIl 0% ha trovato utile questo documento (0 voti)
63 visualizzazioni3 pagine
The document contains a list of 15 lab exercises covering various algorithms topics like sorting, searching, priority queues, heaps, binary search trees, red-black trees, AVL trees, splay trees, B-trees, hashing, and assembly line scheduling. The exercises involve designing and implementing algorithms for operations like insertion, deletion, searching, and traversal and analyzing their time complexities.
The document contains a list of 15 lab exercises covering various algorithms topics like sorting, searching, priority queues, heaps, binary search trees, red-black trees, AVL trees, splay trees, B-trees, hashing, and assembly line scheduling. The exercises involve designing and implementing algorithms for operations like insertion, deletion, searching, and traversal and analyzing their time complexities.
The document contains a list of 15 lab exercises covering various algorithms topics like sorting, searching, priority queues, heaps, binary search trees, red-black trees, AVL trees, splay trees, B-trees, hashing, and assembly line scheduling. The exercises involve designing and implementing algorithms for operations like insertion, deletion, searching, and traversal and analyzing their time complexities.
1) Merge Sort 2) Bubble Sort 3) Insertion Sort 4) Selection Sort Draw the line graph for time complexity. Write a program to sort the array element using 1) Counting Sort 2) Bucket Sort Q1. Given an array S of unsorted elements. Design an algorithm and implement that to find a pair x, y such that xy from S that minimizes |x-y|. The worst case running time of the algorithm should be O (nlgn). Q2. Given two arrays A1 , A2 of size n and a number x, design an algorithm to find whether there exists a pair of elements one from A1 and other from A2 whose sum is equal to x. Also find the indices of those elements. Q3. Develop an algorithm to solve the maximum segment sum problem. Build a Max-Heap Tree for any array. Analyze the operation in terms of running time and find the time complexity of the algorithm. Q1. Implement an algorithm to build a Min-Heap Tree for any array. Analyze the operation in terms of running time and find the time complexity of the algorithm. Q2. Design and implement an algorithm to find the Kth largest elements of an unsorted array in O(n+klgn) time. Implement an algorithm of Max-Priority-Queue for any array of elements having INSERT, EXTRACT-MAX, INCREASE-KEY operations. Analyze its operations in terms of running time and find the time complexity of the algorithm. Q1. Implement an algorithm of Min-Priority-Queue for any array of elements having INSERT, EXTRACTMIN, DECREASE-KEY operations. Analyze its operations in terms of running time and find the time complexity of the algorithm.
Date of Floating Date of Evaluation 2 and evaluation 1
5.
6.
7.
8.
9.
10.
Write a menu driven program showing following
operations in a binary search tree through 1. Inorder Traversal 2. Preorder Traversal 3. Postorder Traversal (A) Insertion (B) Deletion (C) Searching Analyze the operation in terms of running time and find the time complexity of the algorithm. Q1. Design and implement an algorithm to perform LEFT-ROTATE (RIGHT-ROTATE) operation on a binary search tree. Q2. Design and implement an algorithm to perform right rotate operation on a binary search tree. Design and implement an algorithm to insert any number of elements in RED-BLACK Tree. Use the appropriate techniques to show the color of nodes also and analyze its time complexity based on CPU utilization. Design and implement an algorithm to delete any number of elements in RED-BLACK Tree. Use the appropriate techniques to show the color of nodes also and analyze its time complexity on the basis of CPU utilization. Q1. Design and implement codes for basic operations for red black trees are included in the book. Add to the code the following methods: a. Delete a node from the red black tree. b. Count the number of leaves in a tree. c. Return the height of a tree. d. Return a list of all keys in a tree between a and b. Analyze the difference of time complexities on the basis of CPU utilization Q1. Design and implement codes for the construction of AVL tree having any number of nodes given by user and perform single and double rotation as per the requirement of AVL tree. Analyze its time complexity on the basis of CPU utilization. Q2. Design and implement algorithm to create a Splay tree for following operations: (A) Accessing (Searching) (B) Insertion (C) Deletion Analyze its time complexities on the basis of CPU utilization and justify it.
11.
12.
13.
14. 15.
Design and implement algorithm for B-Tree with t
(minimum degree of tree) =3 for following operations: (A) B-Tree Search (B) B-Tree Create (C) B-Tree Insert Analyze its time complexities on the basis of CPU utilization and justify it. Design and implement codes for any TREAP for following operations: (A) Insertion of any priority (B) Deletion of any priority Analyze its time complexities on the basis of CPU utilization and justify it. A hash table of length 200 is required to store a list of Managing Company employees social security numbers. Each element of the array will contain a string (or character array) to hold the first name, an integer to hold the social security number, and a variable to indicate whether the element is empty, used, or deleted. The social security number will be the key for the hash table; your program should use the following hash function to get the index. Index = (social security number) % 200. The entry corresponding to given SSN should be stored at index obtained after applying the above operation. Instruction:Methods you should implement are Add(), add a name and number to the table RemoveElement(), delete a single name from the table GetNumber(), return the number corresponding to a particular name (if present) CountEmpty(), count the number of empty elements in the table Print(), print the contents of all non-empty elements to the screen Design and implement codes for Assembly Line Scheduling Problem for n-number of stations. Find the fastest way to complete an auto from different lines. Design and implement algorithm to find optimal parentheses for the information given.