100% found this document useful (1 vote)
65 views

Data Structure and Algorithm Exam

The document outlines the final examination for a Data Structure and Algorithm course, providing a series of questions across various topics including data structures, algorithms, linked lists, stacks, queues, searching methods, sorting algorithms, and binary trees. Each question requires explanations, definitions, and examples, as well as practical coding exercises. Students are instructed to answer any six questions from the provided list.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
65 views

Data Structure and Algorithm Exam

The document outlines the final examination for a Data Structure and Algorithm course, providing a series of questions across various topics including data structures, algorithms, linked lists, stacks, queues, searching methods, sorting algorithms, and binary trees. Each question requires explanations, definitions, and examples, as well as practical coding exercises. Students are instructed to answer any six questions from the provided list.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

TIMEON KAIROS POLYTECHNIC

326, Lagos- Abeokuta Expressway, Abule-Egba, Lagos.


DATA STRUCTURE AND ALGORITM
COURSE CODE: COM 124
Final Examination (Answer any six)
1
(a) What is data-structure?
(b) Write the types of data-types followed by their subdivisions with examples.
(c) Differentiate between Physical and Logical data structure.

2
(a) What is algorithm?
(b) The three basic control structures in virtually every procedural language are, List and
explain them.
(c) Write the algorithm and draw a flow chat to select the only male from list of 20
students.

3 (a) Explain linear and Non-Linear Linked list?


(b) Write two (2) examples where each is implemented
(c) Write and explain The Five (5) basic operations of Linear list.

4 (a) Write the meaning and the Six (6) Variations/Classes of linked list.
(b) In Linked list, explain the following terms. (i) Node (ii) Pointer (iii) Head (iv) null
(c) Explain the following program and write the possible result that will be visible on the
screen.
int main(void)
{
List list;
list.InsertNode(7.0); // successful
list.InsertNode(5.0); // successful
list.InsertNode(6.0); // successful
list.InsertNode(4.0); // successful
// print all the elements
list.DisplayList();
if(list.FindNode(5.0) > 0) cout << "5.0 found" << endl;
else cout << "5.0 not found" << endl;
if(list.FindNode(4.5) > 0) cout << "4.5 found" << endl;
else cout << "4.5 not found" << endl;
list.DeleteNode(7.0);
list.DisplayList();
return 0;
}
5 (a) What is stack?
(b) Explain the Two basic operation in Stack
(c) What does LIFO stands for?
(d) Using array, fill up the value of queue and show the position of front and rear for each
statement.

1. I am going to execute this code with THREE pushes and ONE pop:
2. IntStack s = new IntStack( );
3. s.push(1);
4. s.push(2);
5. s.push(3);
6. System.out.println(s.pop( ));

Suppose that s is represented by a partially filled array. Draw the state of the private
instance variables of s after the above code:
_______ __________________________________
manyItems| | data| | | | | |
|_______| |______|______|______|______|______|...
[0] [1] [2] [3] [4]

6 (a) What is a queue in data-structure?


(b) Explain the two(2) basic operations performed on Queues?
(c) What does FIFO stands for?
(d) Using array, fill up the value of queue and show the position of front and rear for each
statement.
int main(void) {
double value;
Queue queue(5);
queue.Enqueue(3);
queue.Enqueue(2);
queue.Enqueue(1);
queue.Enqueue(4);
queue.Dequeue(value);
queue.Enqueue(7);
queue.Enqueue(9);
queue.Dequeue(value);
queue.Enqueue(10);
queue.Enqueue(13);
return 0;
}
7 (a) Explain the term “Searching”.
(b) What is Linear/Sequential Searching?
(c) Explain Binary Searching.
(d) Using Binary Search Method, write the steps to search for 34 in the following list of
numbers: 4, 8,19,25,34,39,45, 48, 66, 75, 89, 99

8 (a) Explain the following terms


I. Bubble Sort
II. Selection Sort
III. Insertion Sort
(b) Sort these numbers using bubble sort: 38, 91, 49, 47, 51, 84, 52, 58, 74, 71
(c) Sort these numbers using insertion sort: 38, 91, 49, 47, 51, 84, 52, 58, 74, 71

9 (a) Explain the binary Tree and write the four (4) Classifications of Binary Tree
(b) Explain the Following Terms;
• Node:
• Edges:
• Parent Node:
• Grand Parent:
• Child Node:
• Root Node:
• Leaf Node:
• Level:
• Height:
• Degree of Node:
• Siblings:
• Left Child:
• Right child:
• Left Sub tree:
• Right Sub tree:

You might also like