Download MS.BHUMIKA PATEL

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

B-tree wikipedia , lookup

Binary search tree wikipedia , lookup

Array data structure wikipedia , lookup

Linked list wikipedia , lookup

Transcript
Department of Computer Science and Technology, UTU - 2015
5 years Integrated M.Sc. (IT) – Semester 2
Practical List
060010201 – Data Structures
Practical No. 1
Practical Problem
Enrollment No.
(A) Write a program to create an array for 10 numbers where the
value for 10 numbers are given by user and find out average
of element in array.
Display like: Average of 10 numbers=<sum>/10=<answer>.
[NOTE: Create User define function for calculate average]
(B) Write a program to create an array for 12 numbers and insert
new element to particular position where the value for new
element and position are given by user, other element should
be shifted right.
[NOTE: Create User define function for insert element]
(C) Write a program to perform following operations:
a) Perform C = 2A+B
b) Display output as matrix format. For example
1 2 3
A= 4 6 7
2 1 1
1 2 2
B= 2 3 1
1 1 1
Objective(s)
Pre-requisite
Duration for
completion
PEO(s) to be achieved
PO(s) to be achieved
CO(s) to be achieved
(D) Write a program to find out total number of odd elements in
2-dimensaional array. Where row, column and value of
elements are given by user. Display Like:
1st row has <n1> odd elements.
2nd row has <n2> odd elements.
.
.
Nth row has <nn> odd elements.
Total number of odd elements:<n1+n2+….+nn>
[NOTE: The value for Row and Column are given by user]
Student shall be able to perform different operations on array.
Usage of Array, pass array to function as an argument
6 hours.
PEO2: To provide quality practical skill of tools and technologies to
solve industry problems.
PO6: Ability to use the techniques, skills and modern tools as
necessary for software development.
CO2: Calculate memory allocation of array and perform different
operations on array.
MS.BHUMIKA PATEL 1
Department of Computer Science and Technology, UTU - 2015
Solution must contain
Nature of submission
References for solving
the problem
Post Laboratory
questions
Out of Marks
Secured by the
student
Signature
Date
Practical No. 2
Practical Problem
Algorithm, Program and Output
Handwritten
1. PAI G A V., Data Structures and Algorithms-Concepts,
Techniques and Applications, McGraw Hill.
2. Gilberg, R., Forouzan, B., Data Structures-A Pseudo code
Approach with C++,Thomson.
3. A.M. Berman, Data Structures via C++ Objects by
Evolution, Oxford.
1. How to declare array having size 25?
2. What is the use of index? Can index have negative values?
3. How many elements are there in array A[1:25]?
4. Which data structure is used to store finite number of same
type?
5. Modify program to initialize all elements of array using
random number.
6. What do you mean by dynamic memory allocation?
7. Which formula is used to calculate address in onedimensional array?
8. What is the formula to calculate address of 2-dimensional
array using row major and column major?
9. What is the difference between row major and column major
in memory representation?
10. What is sparse matrix?
11. If base address of A[1:17] is 1003 then what is address of
A[11] using row major?
12. If base address of A[1:7,0:5] is 119 then what is address of
A[4,4] using row major and column major?
Assessment
Solution achieves the desired
Viva
objective(s)
10
5
Enrollment No.
(A) Write a menu driven program to demonstrate following
operations on stack of positive numbers [implement
using array]:
a)
Push
b)
Pop
c)
Peep
(B) Write a program to convert infix expression to postfix
using stack Display Like:
Infix expression :< Expression>.
Postfix expression :< Expression>.
MS.BHUMIKA PATEL 2
Department of Computer Science and Technology, UTU - 2015
Objective(s)
Pre-requisite
Duration for
completion
PEO(s) to be achieved
PO(s) to be achieved
CO(s) to be achieved
[NOTE: implement stack using array].
Student shall be able to perform different operations on stack and
queue.
Usage of Stack and array
4 hours.
PEO2: To provide quality practical skill of tools and technologies
to solve industry problems.
PO6: Ability to use the techniques, skills and modern tools as
necessary for software development.
CO3: Implement and use appropriate data structures such as stacks,
queues.
Solution must contain
Nature of submission
References for solving
the problem
Post Laboratory
questions
Out of Marks
Secured by the
student
Signature
Date
Algorithm, Program and Output
Handwritten
1. PAI G A V., Data Structures and AlgorithmsConcepts, Techniques and Applications, McGraw Hill.
2. Gilberg, R., Forouzan, B., Data Structures-A Pseudo
code Approach with C++,Thomson.
3. A.M. Berman, Data Structures via C++ Objects by
Evolution, Oxford.
1. What is stack?
2. What is the meaning of push, pop and peep?
3. When stack is said to be overflow? Write condition for
the same.
4. When stack is said to be underflow? Write condition for
the same.
List the application of stack.
5. Convert (a*b)/(c+d)-e expression into postfix.
6. Convert (a*b)/(c+d)-e expression into prefix.
7. What is recursion?
Assessment
Solution achieves the desired
Viva
objective(s)
10
5
MS.BHUMIKA PATEL 3
Department of Computer Science and Technology, UTU - 2015
Practical No. 3
Practical Problem
Objective(s)
Pre-requisite
Duration for
completion
PEO(s) to be achieved
PO(s) to be achieved
CO(s) to be achieved
Enrollment No.
(A) Write a menu driven program to demonstrate following
operations on queue. [NOTE: implemented using array]:
a)
Add an element(enqueue)
b)
Remove an element(dequeue)
c)
Display the queue
(B) Write a menu driven program to demonstrate following
operations on circular queue[implemented using array]:
a)
Add an element(enqueue)
b)
Remove an element(dequeue)
c)
Display the queue
Student shall be able to perform different operations on queue.
Usage of Queue and array
4 hours
PEO2: To provide quality practical skill of tools and technologies
to solve industry problems.
PO6: Ability to use the techniques, skills and modern tools as
necessary for software development.
CO3: Implement and use appropriate data structures such as stacks,
queues.
Solution must contain
Nature of submission
References for solving
the problem
Post Laboratory
questions
Out of Marks
Secured by the
student
Algorithm, Program and Output
Handwritten
1. PAI G A V., Data Structures and AlgorithmsConcepts, Techniques and Applications, McGraw Hill.
2. Gilberg, R., Forouzan, B., Data Structures-A Pseudo
code Approach with C++,Thomson.
3. A.M. Berman, Data Structures via C++ Objects by
Evolution, Oxford.
1. What is queue?
2. When queue is said to be full?
3. When queue is said to be empty?
4. What is the difference between stack and queue?
5. What is the difference between queue and circular
queue?
6. What is the drawback of linear queue?
7. What is the difference between deque and queue?
8. Enlist three applications of queue.
Assessment
Solution achieves the desired
Viva
objective(s)
10
5
MS.BHUMIKA PATEL 4
Department of Computer Science and Technology, UTU - 2015
Signature
Date
Practical No. 4
Practical Problem
Objective(s)
Enrollment No.
(A) Create a singly linked list of numbers and demonstrate
following operation on it:
a)
Add a node(at the beginning)
b)
Remove a node(based on position)
c)
Update the value in the node(based on the
position of the node)
d)
Display the list.
(B) Create a doubly linked list of numbers and demonstrate
following operation on it:
a)
Add a node(at the beginning)
b)
Remove a node(based on position)
c)
Update the value in the node(based on the
position of the node)
d)
Display the list.
(C) Create a circular singly linked list of numbers and
demonstrate following operation on it:
a)
Add a node(at the beginning)
b)
Remove a node(based on position)
c)
Update the value in the node(based on the
position of the node)
d)
Display the list.
(D) Assume that there is one existing singly linked list,
which will store information of employee like employee
no, name and salary. Create menu driven program for
following operations.
a)
Remove method: which will ask user to insert
employee no and it will remove all the
information of employee whose employee no is
match with inputted employee no.
b)
Display method:
Display information of
employee from singly linked list.
(E) Write a simple railway ticket reservation program. The
program should display a menu with the following
options: reserve a ticket, cancel a reservation, check
whether a ticket is reserved for a particular person, and
display the passengers. The information is maintained on
an alphabetized linked list of names. In a simpler version
of the program, assume that tickets are reserved for only
one train.(Use Singly Linked List)
To understand the working and application related to singly linked
list.
To understand the working and application related to doubly linked
MS.BHUMIKA PATEL 5
Department of Computer Science and Technology, UTU - 2015
list.
To understand the working and application related to circular
linked list.
To understand the working and application related to linked list.
Pre-requisite
Duration for
completion
PEO(s) to be achieved
PO(s) to be achieved
CO(s) to be achieved
Solution must contain
Nature of submission
References for solving
the problem
Post Laboratory
questions
Out of Marks
Secured by the
student
Signature
Date
Usage of Linked List
10 hours
PEO2: To provide quality practical skill of tools and technologies
to solve industry problems.
PO6: Ability to use the techniques, skills and modern tools as
necessary for software development.
CO3: Implement and usage of linked list.
Algorithm, Program and Output
Handwritten
1. PAI G A V., Data Structures and AlgorithmsConcepts, Techniques and Applications, McGraw Hill.
2. Gilberg, R., Forouzan, B., Data Structures-A Pseudo
code Approach with C++,Thomson.
3. A.M. Berman, Data Structures via C++ Objects by
Evolution, Oxford.
1. What is linked list?
2. How will I know whether the node is a fist node in the
list or not?
3. How will I know whether the node is a last node in the
list or not?
4. What is the need for linked representations of list?
5. What is the drawback of singly linked list?
6. What is the difference between singly and doubly linked
lists?
7. What is the difference between singly circular linked list
and doubly circular linked list?
8. What is the node structure of circular singly linked list?
9. What is object?
10. How to access member function?
11. What is the node structure of linked list?
12. What is dynamic memory allocation?
Assessment
Solution achieves the desired
Viva
objective(s)
10
5
MS.BHUMIKA PATEL 6
Department of Computer Science and Technology, UTU - 2015
Practical No. 5
Practical Problem
Objective(s)
Pre-requisite
Duration for
completion
PEO(s) to be achieved
PO(s) to be achieved
CO(s) to be achieved
Solution must contain
Nature of submission
References for solving
the problem
Post Laboratory
questions
Enrollment No.
(A) Create an array of 20 elements and apply following
techniques to search it.
a) Linear Search
b) Binary Search
Calculate the time taken by each sorting technique.
(B) Create an array of 20 elements and apply following
techniques to sort it.
a) Selection sort
b) Bubble sort
c) Insertion sort
d) Merge sort
e) Quick sort
Calculate the time taken by each sorting technique.
To understand the implementation and usage of searching.
To understand the implementation and usage of sorting.
Usage of Searching
Usage of Sorting.
8 hours
PEO2: To provide quality practical skill of tools and technologies
to solve industry problems.
PO6: Ability to use the techniques, skills and modern tools as
necessary for software development.
CO5: Implement and use searching and sorting techniques based
on comparative study of Bubble sort, Selection sort, Insertion sort,
Quick sort, Linear search, Binary search.
Algorithm, Program and Output
Handwritten
1. PAI G A V., Data Structures and AlgorithmsConcepts, Techniques and Applications, McGraw Hill.
2. Gilberg, R., Forouzan, B., Data Structures-A Pseudo
code Approach with C++,Thomson.
3. A.M. Berman, Data Structures via C++ Objects by
Evolution, Oxford.
1. What is the Complexity of worst case and best case in
ordered linear search?
2. What is the complexity of worst case and best case in
unordered linear search?
3. What are the advantages of binary search over linear
search?
4. In linked list, which searching technique is better linear
search or binary search?
5. Can bubble sort ever perform better than quick sort?
6. Which sorting techniques are an example of divide and
conquer?
7. Which sorting techniques is an application of recursion?
MS.BHUMIKA PATEL 7
Department of Computer Science and Technology, UTU - 2015
Out of Marks
Secured by the
student
Signature
Date
8. What is the time complexity of quick sort?
Assessment
Solution achieves the desired
Viva
objective(s)
10
5
MS.BHUMIKA PATEL 8