CS9215-SET II.pdf

Embed Size (px)

Citation preview

  • 7/27/2019 CS9215-SET II.pdf

    1/3

    ANNA UNIVERSITY: CHENNAI 600 025

    M.E./M.Tech. DEGREE EXAMINATIONS, JAN - 2012

    Regulations - 2009

    First Semester

    (Computer Science and Engg. / Information Technology)

    CS9215: DATA STRUCTURES LAB

    Time: 3 Hours Maximum Marks: 100

    1. Write to program to construct a binary min heap and perform percolate up and

    deleteMin operations.(100)

    2.. Write to program to implement a binary min heap and use it to sort the given

    numbers.(100)

    3. Write a program to implement a binary min heap and perform the following

    operations(100)

    a.Delete the minimum element.

    b.Search if x is contained in the heap

    c.Print the elements of heap.

    4. Generate Huffman codes for the given frequency of characters using binary min

    heap. A:5 B:8 C:2 D:10 E:4(100)

    5. Write a program to implement a deap data structure and perform the followingoperations

    (100)

    a.Insertion of n elements

    b.Insert an element x if it is not contained already

    c.Print the elements

  • 7/27/2019 CS9215-SET II.pdf

    2/3

    6. Devise a program to construct a leftist heap and perform the following operations (100)

    a.Insertion into an initially empty leftist heap

    b.Search

    7. Write functions to create and initialize two height biased leftist heaps and mergethem. Use a main function to invoke the sub functions.

    (100)

    11. Write a program to implement AVL tree with single rotations and perform the

    following operations(100)

    a.Insertion with AVL single rotations

    b.Display the elements

    9.

    Write a program to insert n numbers using AVL single rotations into an initially

    empty AVL tree. Write the necessary recursive functions to perform searchoperation.

    (100)

    10. Write a program to construct a B-tree and perform Insertion and Searchoperations.

    (100)

    11. Devise a program to construct a B-tree and perform the following operations (100)

    a.Insertion

    b.Node Split

    13. Write a program to implement quick sort and sort the names of n students of

    ABC university. (use alphabets only in names).(100)

    14. Write non recursive functions to sort n numbers using quick sort. Use a mainfunction to invoke all the sub functions.

    (100)

    15. Write a program to implement quick sort by choosing the pivot elementrandomly and sort n numbers.

    (100)

    16. Devise a program to construct a Trie data structure with strings as input and

    perform the following operations(100)

    a.Insertion

    b.Deletion

    17. Implement an algorithm following the divide and conquer strategy to compute

    the convex hull of a set of n previously sorted points.(100)

  • 7/27/2019 CS9215-SET II.pdf

    3/3

    18. Implement the incremental algorithm to compute the convex hull of a set of

    points in the plane, previously sorted by their abscissae.(100)

    19. Write a program to implement Graph coloring algorithm using backtracking. (100)

    20. Write a program to implement 0/1 knapsack using dynamic programming. (100)