Download 3581 - Allama Iqbal Open University

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

Quadtree wikipedia , lookup

Interval tree wikipedia , lookup

Linked list wikipedia , lookup

Array data structure wikipedia , lookup

Binary tree wikipedia , lookup

Binary search tree wikipedia , lookup

Transcript
Final: 27-7-2016
ALLAMA IQBAL OPEN UNIVERSITY, ISLAMABAD
(Department of Computer Science)
WARNING
1.
2.
PLAGIARISM OR HIRING OF GHOST WRITER(S) FOR SOLVING
THE ASSIGNMENT(S) WILL DEBAR THE STUDENT FROM AWARD
OF DEGREE/CERTIFICATE, IF FOUND AT ANY STAGE.
SUBMITTING ASSIGNMENT(S) BORROWED OR STOLEN FROM
OTHER(S) AS ONE’S OWN WILL BE PENALIZED AS DEFINED IN
“AIOU PLAGIARISM POLICY”.
Course: Data Structures (3581/3425)
Level: PGD (CS)
Semester: Autumn 2016
Total Marks: 100
ASSIGNMENT No. 1
Note: All questions carry equal marks.
Q. 1 (a)
(b)
Q. 2 (a)
(b)
List out the areas in which data structures are applied extensively.
How does variable declaration affect memory allocation? Also explain
the concept of Data abstraction?
Discuss representation schemes of array in memory with the help of
diagram.
Write algorithm to access the array elements. Convert the algorithm
into any programming language code as specified by your instructor.
Q. 3 Explain the following algorithms

Insert an item into an array

Delete an item from an array
Q. 4 Define stack. Also explain the representation of stack elements in stack.
State your answer with the help of diagram
Q. 5 Convert the following infix notation to postfix:
( A + B ^ D) / ( E – F) + G
A * ( B + D )/ E – F * ( G + H / K)
ASSIGNMENT No. 2
Total Marks: 100
Note: All questions carry equal marks.
Q. 1 (a)
(b)
Q. 2 (a)
(b)
Define and explain queue, de-queue, and priority queue. Give memory
representation of simple queue, de-queue (circular queue), and priority
queue.
Write an algorithm for the insertion (QINSERT) and deletion
(QDELETE) of an element from a queue.
Are linked lists considered linear or non-linear data structures? Why
would we use a linked list instead of an array to implement a stack? Or
a queue?
Explain the advantages and disadvantages of using a linked list.
Q. 3 Given the following binary tree. Write its post-order traversal and in-order
traversal.
10
3
4
20
7
19
8
Q. 4 (a)
(b)
Differentiate between binary tree and binary search tree.
Draw the binary search tree for the following inputs.
70,15,29,33,44,12,79.
Q. 5 (a)
(b)
Explain the basic algorithm for searching a binary search tree.
Give the best case and worst case analysis of the binary search.
2
3581(Old 3425) Data Structure & Applications
Recommended Book: An Introduction to Data Structures By Trembly
Course Outlines:
Unit No.1 Introduction
a) Basic Terminologies
b) Introduction to Data Structures
c) Data Structure (Classification, Types, Operation)
d) Basics of Algorithms, Notation used
e) Importance of Algorithms for Optimized Application Development
f)
Introduction to Analysis of Algorithms
Unit No.2 Arrays
a) Arrays (Definition and Examples)
b) Representation of array in Memory.
c) Accessing & Traversing Array, Inserting & Deleting
d) Multi Dimensional Arrays & their Representation in Memory.
Unit No.3 Stacks
a) Stack, Importance of Stack, Array Representation of Stacks
b) Stack Operations (PUSH and POP operations)
c) Infix, Postfix and Prefix Expressions
Unit No.4 Queues
a) Queue, Representation of Queues
b) Operation Perform on Queue (Inserting and Removing Nodes)
c) De-queues, Priority queues
Unit No.5 Linked Lists
a) Linked Lists Concept, Representation of Linked Lists in Memory
b) Traversing & Searching a Linked List, Insertion & Deletion in
Linked List
c) Types of Linked Lists
3
Unit No.6 Trees
a) Tree
b) Tree Types (Simple, Binary, General)
c) Representation of Binary Tree in Memory
d) Traversing (Pre order, In order, Post order).
e) Basic Operation (Insertion Deletion).
Unit No.7 Sorting & Searching
a) Bubble Sort, Quick Sort, Insertion Sort, Selection Sorting
b) Sequential Search, Binary Search
Unit No.8 Graphs
a) Graph Theory Terminology, Linked Representation of Graphs
b) Directed and Undirected Graphs, Traversal Methods
Unit No.9 Files and Data Storage
a) Basic Operations on Different Files Organizations
b) Add, Update and Delete Record
c) File Organizations
1.
Sequential
2.
Indexed Sequential
3.
Direct (Hashing)
4.
Merging Files

4