Você está na página 1de 5

1. Kindly do every program in each section which comes after (RollNo MOD 20).

For Example If your Roll no is 10002034 then (10002034 MOD 20) is 14. So you are supposed to do 14th question of each section. If Mod comes out to be zero then do the 20th question. 2. Your Filename of the program should be SectionNumber followed by first four letters of your name followed by question number followed by extension of the file as per the language or script you are using. For example Sec1deep14.php 3. Your Submission should mention that till what input size or the actual input number your program works. What are its time and space complexity and how much time it takes? 4. You are supposed to write the efficient algorithm as far as possible. Brute Force algorithms without any improvements will not get any marks. 5. Every Question is of five marks. Assignments submitted after due time will be marked out of the half of the allotted marks. 6. You are encouraged to do active collaboration for discussing the solution with others and to take new ideas from the internet but plagiarism and any unfair practice of copying may lead to cancellation of current and previous assignments also. 7. Soft copy and hard copy is to be submitted online latest by 21st September, 2012 5.00 P.M after which the system will not accept your submission. 8. Submit your assignment as zip file with name as Groupname followed by rollno followed by assignment number like G1BE10008031A2 The subject of your email also should be same and it should be sent to dgarg@thapar.edu Files without proper naming conventions will not be accepted.

Section-6 1. Write an efficient program to insert a record in an array. It should take care of the exception if the array is already full. Insertion should be done after a given number in the array. 2. Write an efficient program to delete a given record in an array. 3. Write an efficient program to merge two given arrays in one array. It should take care of the fact that if it is possible to merge in one of the available arrays or you requires creating a new array of larger size. 4. Write an efficient program to Split an array in two arrays. Splitting should be done based on odd and even numbers respectively. In the end you will have two arrays; one containing even numbers and other containing odd numbers. 5. Write an efficient program to Intersect two given arrays in one new array. 6. Write an efficient program to Union two given arrays in one new array. 7. Write an efficient program to insert a record in a Singly Link List. Insertion should be done after a given number in the list. 8. Write an efficient program to delete a given record in a singly link list. 9. Write an efficient program to merge two given Singly Link lists in one list. 10. Write an efficient program to Split a link list in two singly link lists. Splitting should be done based on odd and even numbers respectively. In the end you will have two singly link lists; one containing even numbers and other containing odd numbers. 11. Write an efficient program to Intersect two given Link lists in one new Link List. 12. Write an efficient program to Union two given Link Lists in one new Link List. 13. Write an efficient program to insert a record in a Circular Link List. Insertion should be done after a given number in the list. 14. Write an efficient program to delete a given record in a Circular link list. 15. Write an efficient program to merge two given Circular Link lists in one Circular Link list. 16. Write an efficient program to Split a Circular link list in two Circular link lists. Splitting should be done based on odd and even numbers respectively. In the end you will have two Circular link lists; one containing even numbers and other containing odd numbers. 17. Write an efficient program to Intersect two given Circular Link lists in one new Circular Link List. 18. Write an efficient program to Union two given Circular Link Lists in one new Circular Link List. 19. Write an efficient program to insert a record in a Doubly Link List. Insertion should be done after a given number in the list. 20. Write an efficient program to delete a given record in a doubly link list.

Section-7 1. Write an efficient program to insert a record in a stack. It should take care of the exception if the stack is already full. 2. Write an efficient program to delete in a stack. It should take care of the exception if the stack is already empty. 3. Write an efficient program to merge two given stacks in one stack. 4. Write an efficient program to Split a stack in two stacks. Splitting should be done based on odd and even numbers respectively. In the end you will have two arrays; one containing even numbers and other containing odd numbers in the same order as in the original stack. 5. Write an efficient program to Intersect two given stacks in one new stack. 6. Write an efficient program to Union two given stacks in one new stack. 7. Write an efficient program to insert a record in a queue. It should take care of the exception if the queue is already full. 8. Write an efficient program to delete in a queue. It should take care of the exception if the queue is already empty. 9. Write an efficient program to merge two given queues in one queue. 10. Write an efficient program to Split a queue in two queues. Splitting should be done based on odd and even numbers respectively. In the end you will have two queues; one containing even numbers and other containing odd numbers in the same order as in the original queue. 11. Write an efficient program to Intersect two given queues in one new queue. 12. Write an efficient program to Union two given queues in one new queue. 13. Write an efficient program to insert a record in an Entry restricted queue. In this deletion can be at both ends. It should take care of the exception if the queue is already full. 14. Write an efficient program to delete in an Entry restricted queue. In this deletion can be at both ends. It should take care of the exception if the queue is already empty. 15. Write an efficient program to insert a record in an Exit restricted queue. In this insertion can be at both ends. It should take care of the exception if the queue is already full. 16. Write an efficient program to delete in an Exit restricted queue. In this insertion can be at both ends. It should take care of the exception if the queue is already empty. 17. Write an efficient program to implement stack using two queues. Push and Pop should be implemented using queue operations. 18. Write an efficient program to implement queue using two stacks. Enqueue and Dequeue should be implemented using stack operations. 19. Write an efficient program to insert a record in a priority queue. It should take care of the exception if the queue is already full. Insertion should be done at a proper place as per the priority. 20. Write an efficient program to delete in a priority queue. Assume that at the time of insertion priority has not been taken into consideration and the numbers are stored as they arrive. So priority needs to be considered at the time of deletion. It should take care of the exception if the queue is already empty.

Section 8 1. Write an efficient program for Bubble Sort. It should include the two improvements namely a) If there is no swap in the current pass then the sequence is sorted b) Next pass should stop at the last swap of the previous pass. It should take care of the duplicate elements. 2. Write an efficient program for Sinking Sort. It should include the two improvements namely a) If there is no swap in the current pass then the sequence is sorted b) Next pass should stop at the last swap of the previous pass. It should take care of the duplicate elements. 3. Write an efficient program for Selection Sort. It should include the improvement namely minmax checking in the same pass so that the largest goes to the last place and smallest goes to the first place. It should take care of the duplicate elements. 4. Write an efficient program for insertion sort. It should include the improvement namely binary searching within the sorted numbers. It should take care of the duplicate elements. 5. Write an efficient program for Merge sort. It should take care of the duplicate elements. It should be out-of-place Merge Sort where we use additional memory. 6. Write an efficient program for Merge sort. It should take care of the duplicate elements. It should be in-place Merge Sort where we dont use additional memory. 7. Write an efficient program for merging two sorted lists into a single sorted list. 8. Write an efficient program for Shell sort. 9. Write an efficient program for Heap sort. Heap to be taken is Max-Heap. 10. Write an efficient program for Heap sort. Heap to be taken is Min-Heap. 11. Write an efficient program for Counting sort where sorting may be unstable also. 12. Write an efficient program for Counting sort where sorting has to be stable sorting. 13. Write an efficient program for MSD (Most Significant Digit) based Radix sort. 14. Write an efficient program for LSD (Least Significant Digit) based Radix sort. 15. Write an efficient program for Quick Sort using first number as the pivot. 16. Write an efficient program for Quick Sort using the median of first five numbers as the pivot. 17. Write an efficient program to find the median of given numbers. 18. Write an efficient program for Merge sort. However below the threshold of 8 numbers, it should use Insertion sort. 19. Write an efficient program for Merge sort. However below the threshold of 8 numbers, it should use Selection sort. 20. Write an efficient program for LSD (Least Significant Digit) based Radix sort. First convert the numbers into binary and then apply the radix sort.

Section-9 1. Write an efficient program for insertion in a given binary search tree. 2. Write an efficient program for deletion in a given binary search tree. 3. Write an efficient program to find all the siblings of a number in a given binary search tree. 4. Write an efficient program to find the pre order of a given binary search tree. 5. Write an efficient program to find the postorder of a given binary search tree. 6. Write an efficient program to find the inorder of a given binary search tree. 7. Given pre order and inorder of a binary search tree, find postorder of the tree. 8. Given postorder and inorder of a binary search tree, find pre order of the tree. 9. Write an efficient program to find all the external nodes of a given binary search tree. 10. Write an efficient program to find all the internal nodes of a given binary search tree. 11. Write an efficient program to find the successor of a number in a given binary tree. 12. Write an efficient program to find the predecessor of a number in a given binary tree. 13. Write an efficient program to find the sequence of nodes in a Graph using Depth First Search. 14. Write an efficient program to find the sequence of nodes in a Graph using Breadth First Search. 15. Write an efficient program to find the whether any cycle exists in the given Graph or Not. 16. Write an efficient program to list all the nodes of a graph with either indegree or out degree as three. 17. Write an efficient program to list all the connected Components of a given Graph. 18. Write an efficient program to find whether a given Graph has a Euler Path or not. 19. Write an efficient program to find whether a given Graph is Bipartite or not. 20. Write an efficient program to find the topological ordering of a Directed Acyclic Graph.

Você também pode gostar