0% found this document useful (0 votes)
40 views

Assignment

This document provides instructions for an assignment in the IT200: Data Structures and Algorithms course due on November 13th, 2014. The assignment is worth 10% and contains 5 problems worth 4 marks each. It provides details on formatting requirements, deadlines, explaining steps, original work, and time complexities expected for algorithms. The problems cover solving recurrences, linked list operations, merging sorted lists, AVL trees, and graph examples.

Uploaded by

Rohit M A
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views

Assignment

This document provides instructions for an assignment in the IT200: Data Structures and Algorithms course due on November 13th, 2014. The assignment is worth 10% and contains 5 problems worth 4 marks each. It provides details on formatting requirements, deadlines, explaining steps, original work, and time complexities expected for algorithms. The problems cover solving recurrences, linked list operations, merging sorted lists, AVL trees, and graph examples.

Uploaded by

Rohit M A
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

IT200: Data Structures and Algorithms

Instructors: Raghavendra G S/Ashwin T S

ASSIGNMENT
Due: Nov 13th, 2014. 10:05 AM

Read the following instructions:


1. This assignment carries 10% weightage.
2. It contains 5 main problems, 4 marks each. the marks will be divided by two to
adjust it to the weightage mentioned above.
3. Assignments should be handwritten and legible, on A4 size sheets of good quality,
neatly stapled. buff sheets and sheets torn from books will not be evaluated and
be given zero marks. Utter foolishness exhibited by not mentioning your name and
register number will be awarded with zero marks.
4. There will be no extension of the deadline. All late submissions will be rejected.
5. All steps should be explained properly and should be rigorous. Any assumptions
made must be stated properly. Anything skipped will affect your final marks.
6. When asked to suggest/provide an algorithm, the most optimal algorithm should be
given unless a particular one has been specifically asked (like give O(n2 ) algorithm
etc), failing which full marks will not be given.
7. All algorithms should be provided with pseudo-code/steps. lengthy descriptions will
not be evaluated.
8. Plagiarism is highly discouraged. Assignment copied from internet, from your
batch-mates or any other possible/probable sources will straight away be given zero.
Youll be asked to explain the answers in person. One of your instructors happen
to be your super senior which implies that he knows most of your tricks.

1.

(4 marks) Solve the following recurrences using repeated expansion or recursion


tree. Assume T (n) = 1 in both the cases.
a. (2 marks)

T (n) = 4T ( n3 ) + n2

b. (2 marks)

T (n) = 3T ( n2 ) + n3

2.

(4 marks) Doubly Linked Lists can be implemented using one pointer instead of two.
This can be achieved by a specific binary operation on two pointers next and previous,
assuming pointers can be interpreted as k-bit integers. Assume that you have (access to)
head and tail pointers. Using this particular representation,
a. (3 marks)

Give algorithms to implement insert, search, delete on this list.

b. (1 mark )

Give an algorithm to reverse this list is O(1).

Provide all the details which you think as relevant.

3.

(4 marks) Solve the following

a. (3 marks)
As an auxiliary algorithm for merge sort, we have seen how two
sorted arrays/lists can be merged into a single sorted array/list. Give an algorithm of
time complexity of O(n lg k) to merge k-arrays/lists which are sorted into a single sorted
array/list. Here n is total number of elements.
b. (1 mark )
What is the optimal Huffman code for the following set A =
{a, b, c, d, e, f, g} if the frequencies are given by F = {1, 1, 2, 3, 5, 8, 13} i.e. first seven
Fibonacci numbers. Can you generalise the answer for the case when the frequencies are
first n Fibonacci numbers?

4.

(4 marks) Solve the following

a. (2 marks)
An AVL tree is constructed for the input set A = {1, 2, 3, 4, 5} in
some order specified by the permutations of the set A. Find the permutations for which
there is no need to do any rotations at any stage during insertions.
b. (1 mark )

Complexity of insertion in an AVL tree is given by the expression

c. (1 mark )

Complexity of deletion in a BST is given by the expression

5.

(4 marks) Provide examples or give reasons as to why it is impossible to provide


examples for.
a. (2 marks) A five node directed graph with some edges having negative weights
such that Dijkstras Algorithm always works correctly on it.
b. (1 mark )
A connected graph where the maximum cost edge is part of every
possible minimum spanning tree.
c. (1 mark )
spanning tree.

A connected graph where a least cost edge is not part of any minimum

You might also like