Data Structures-Computer Science-Assignment, Exercises of Data Structures and Algorithms

I uploaded assignments for many different subjects related my degree Computer Science. This assignment for Data Structures includes: Data, Structure, Operation, Array, Coloumn, Row, Address, Stack, Queue, List, Link, Delete, Memory, Algorithm

Typology: Exercises

2011/2012

Uploaded on 08/25/2012

jonny2
jonny2 🇮🇳

4.3

(18)

53 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
WARNING
1. PLAGIARISM OR H IRING OF G HOST WRITER(S) FO R SOLV ING
THE ASS IGNMENT(S) WILL D EBAR T HE ST UDENT FR OM AW ARD
OF DEGREE/CERTIFICATE, IF FOUND AT ANY STAGE.
2. SUBMITTING ASSIGNMENT(S) BORROWED OR ST OLEN FR OM
OTHER(S) AS ON E’S OWN WILL
Course: Data Structures (3408) Semester: Spring, 2012
Level: BS (CS) Total Marks: 100
Pass Marks: 50
ASSIGNMENT No. 1
(Units: 1–4)
Note: All questions are compulsory. All questions carry equal marks.
Q. 1 (a) Define data structure. Name and explain different types of data structure.
Explain operations that can be performed on these data structures.
(b) What is an algorithm? What is time and space analysis of an algorithm?
Elaborate the concept of the best, average & worst cases analysis.
Q. 2 (a) What are the principle differences between arrays and structures? How address
calculations are performed for the access of an item for each?
(b) A dynamically declared array A is defined with row and column subscripts
varying from 1 to 5. Give the storage mapping function to map A into
memory assuming column-major and row-major storage order.
Q. 3 (a) Define and explain stack. Give representation of a stack in memory.
(b) Write an algorithm and a program for the insertion (push) and deletion (pop)
of an element from a stack.
Q. 4 (a) What are infix, postfix and prefix notations? Write an algorithm for the
conversion of infix expression to polish or reverse polish expression.
(b) Give a trace for the translation of given infix string to polish and reverse
polish string. A / B – C * D + A
Q. 5 (a) Define and explain queue and de-queue. Give memory representation of
each.
(b) Formulate an algorithm and a program for the insertion and deletion of an
element from a queue.
docsity.com
pf3

Partial preview of the text

Download Data Structures-Computer Science-Assignment and more Exercises Data Structures and Algorithms in PDF only on Docsity!

WARNING

1. PLAGIARISM OR H IRING OF G HOST WRITER(S) FO R SOLV ING

THE ASS IGNMENT(S) WILL D EBAR T HE ST UDENT FR OM AW ARD

OF DEGREE/CERTIFICATE, IF FOUND AT ANY STAGE.

2. SUBMITTING ASSIGNMENT(S) BORROWED OR ST OLEN FR OM

OTHER(S) AS ON E’S OWN WILL

Course: Data Structures (3408) Semester: Spring, 2012 Level: BS (CS) Total Marks: 100 Pass Marks: 50

ASSIGNMENT No. 1

(Units: 1–4)

Note: All questions are compulsory. All questions carry equal marks.

Q. 1 (a) Define data structure. Name and explain different types of data structure. Explain operations that can be performed on these data structures. (b) What is an algorithm? What is time and space analysis of an algorithm? Elaborate the concept of the best, average & worst cases analysis.

Q. 2 (a) What are the principle differences between arrays and structures? How address calculations are performed for the access of an item for each? (b) A dynamically declared array A is defined with row and column subscripts varying from 1 to 5. Give the storage mapping function to map A into memory assuming column-major and row-major storage order.

Q. 3 (a) Define and explain stack. Give representation of a stack in memory. (b) Write an algorithm and a program for the insertion (push) and deletion (pop) of an element from a stack.

Q. 4 (a) What are infix, postfix and prefix notations? Write an algorithm for the conversion of infix expression to polish or reverse polish expression. (b) Give a trace for the translation of given infix string to polish and reverse polish string. A / B – C * D + A

Q. 5 (a) Define and explain queue and de-queue. Give memory representation of each. (b) Formulate an algorithm and a program for the insertion and deletion of an element from a queue.

ASSIGNMENT No. 2

(Units: 5–8) Total Marks: 100 Pass Marks: 50

Note: All questions carry equal marks.

Q. 1 (a) What is linked list? What are its types? Give representation of a linked list in memory. (b) Formulate an algorithm to insert an element at the start of the linked list and to delete an element from the middle of the linked list.

Q. 2 (a) Define arid explain tree and its types. Give linked representation of a binary tree in memory. (b) Formulate an algorithm and a program for the pre-order, post-order and in- order traversal of binary tree. Illustrate with the help of diagrams.

Q. 3 (a) Give time complexities of Bubble sort, Insertion sort, Selection sort, Quick sort, Merge sort, Radix sort, Binary search, and Sequential search in tabular form. (b) Give trace of Bubble sort, Insertion sort, and Selection sort using one suitable example for each.

Q. 4 (a) Give trace of Binary search and Sequential search using examples. (b) What is a graph and what are its types? Give matrix and adjacency list representation of an example graph in memory?

Q. 5 Explain each step with graph example for the trace of Breadth first search and Depth first search graph traversal algorithms.