Download Assignment I,II and III - MLR Institute of Technology

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Rainbow table wikipedia , lookup

Array data structure wikipedia , lookup

Control table wikipedia , lookup

Lattice model (finance) wikipedia , lookup

B-tree wikipedia , lookup

Linked list wikipedia , lookup

Quadtree wikipedia , lookup

Red–black tree wikipedia , lookup

Interval tree wikipedia , lookup

Binary tree wikipedia , lookup

Binary search tree wikipedia , lookup

Transcript
MLR Institute of Technology
Laxma Reddy Avenue, Dundigal, Quthbullapur (M), Hyderabad – 500 043
Phone Nos: 08418 – 204066 / 204088, Fax : 08418 – 204088
ASSIGNMENT
Course Name
Course Code
Class
Branch
Year
Course Faculty
:
:
:
:
:
:
DATA STRUCTURES
A30502
II B.Tech I Semester
Computer Science and Engineering
2015-16
Mrs. L. Lakshmi, Assoc.Professor
Mr. Gouse Sheik, Associate Professor
Mr. Madhuravani , Assistant Professor
Mr. K. Praveen Kumar, Asst.Prof
OBJECTIVES:
1. To understand the basic concepts such as Abstract Data Types, Linear and
Non Linear Data structures.
2. To understand the notations used to analyze the Performance of algorithms.
3. To understand the behavior of data structures such as stacks, queues, trees,
hash tables, search trees, Graphs and their representations.
4. To choose the appropriate data structure for a specified application.
5. To understand and analyze various searching and sorting algorithms.
6. To write programs in C to solve problems using data structures such as
arrays, linked lists, stacks, queues, trees, graphs, hash tables, search trees.
Blooms
Taxonomy Level
Course
Outcome
Analyze
5
Evaluate
4
Understand
4
Understand
5
Analyze
4
Understand
2
Understand
2
Write a program to implement the basic operations
of a Queue using arrays.
Write a program to implement the basic operations
of a Stack using arrays.
Write a C program to convert infix to polish
notation.
UNIT - III
Explain how a general tree can be represented as a
Binary Tree.
Explain the representations of graph with an
examples.
Understand
2
Understand
2
Understand
2
Understand
5
Understand
5
Write the non-recursive algorithm to traverse a tree
Understand
5
S.No
1
2
3
4
5
1
2
Question
UNIT - I
An algorithm takes 0.5ms for input size 100. How
long will it take for input size 500 if the running
time is the following:
a) Linear
b) O(NlogN)
c) Quadratic
d) Cubic
How do you find the complexity of an algorithm?
What is the relation between the time and space
complexities of an algorithm?
Justify your answer with an example.
Given a singly linked list. Write a function swap to
swap every two nodes e.g. 1->2->3->4->5->6 should
become 2->1->4->3->6->5.
Explain an efficient way of storing a sparse matrix
in memory. Write a module to find the transpose of a
sparse matrix stored in this way.
Compare and Contrast singly linked list and doubly
linked list with suitable examples.
UNIT - II
Write a C program to implement the following
operations using Singly linked list.
a. Create a single linked list with N number of
nodes.
b. Insert a new node at the end.
c. Delete a node from the beginning.
d. Insert a node at the middle.
Write a C program to evaluate the following postfix
expression?
10 2 8 * + 3 -
3
4
5
1
2
3
4
5
1
2
3
4
5
1
2
3
4
5
in preorder
Translate the following infix expressions into its
equivalent postfix expressions; (i) (A + B ↑ D)/(E −
F)+ G
(ii) A*(B+ D)/ E − F*(G + H/ K)
Construct a binary tree whose nodes in inorder and
preorder are given as
follows:
Inorder : 10, 15, 17, 18, 20, 25, 30, 35, 38, 40, 50
Preorder: 20, 15, 10, 18, 17, 30, 25, 40, 35, 38, 50
UNIT - IV
The following values are to be stored in a hash table
25, 42, 96, 101, 102, 162, 197
Describe how the values are hashed by using
division method of hashing with a table size of 7.
Use chaining as the method of collision resolution.
Compare the time complexities of linear search and
binary search with
suitable examples?
An Array contains a list of integers 3, 13, 7, 26, 44,
23, 98, 57, 65, 24, 84, 37. Design a C program to
sort the array elements using quick sort and trace the
steps?
Show the various passes of insertion sort on an
unsorted list 11, 15, 2, 13, 6
Write a C program to sort the given elements using
Quick Sort.
UNIT - V
Write a C program to perform the following BST
operations
i)
Creation ii) Traversal
Write a C program to perform the following AVL
operations
Creation ii) Traversal
Given a Binary Search Tree. Write an algorithm to
Tree check whether the tree is an AVL tree or not
and discuss the run time complexity.
Explain the concept of tries with suitable examples.
Construct a B-tree of order 5 for the following data.
3,14,7,1,8,5,11,17,13,6,23,12,20,26,4,16,18,24,25,19
Apply
4
Apply
4
Understand
5
Analyze
4
Understand
5
Apply
4
Understand
5
Understand
5
Understand
5
Understand
5
Understand
Apply
5
4