0% found this document useful (0 votes)
850 views2 pages

DST Questions

This document contains 5 questions related to data structures and algorithms. Question 1 defines terms like pseudocode, algorithm, ADT, data abstraction, and pointer. Question 2 distinguishes between formal/actual parameters, procedures/functions, repeat-until/while loops, and IF/CASE structures. It also covers pass by value and pass by reference. Question 3 provides a problem to write a program to multiply two 2x2 matrices using procedures and functions. Question 4 involves (a) writing an algorithm for sequential search and (b) writing a procedure to count nodes in a linked list. Question 5 involves (a) building a set of a user-determined size and (b) searching for a user-entered integer in that set
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
850 views2 pages

DST Questions

This document contains 5 questions related to data structures and algorithms. Question 1 defines terms like pseudocode, algorithm, ADT, data abstraction, and pointer. Question 2 distinguishes between formal/actual parameters, procedures/functions, repeat-until/while loops, and IF/CASE structures. It also covers pass by value and pass by reference. Question 3 provides a problem to write a program to multiply two 2x2 matrices using procedures and functions. Question 4 involves (a) writing an algorithm for sequential search and (b) writing a procedure to count nodes in a linked list. Question 5 involves (a) building a set of a user-determined size and (b) searching for a user-entered integer in that set
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Question 1

Define the following terms as they are used in data structures and algorithms.

(i) Pseudocode
(ii) Algorithm
(iii) ADT
(iv) Data abstraction
(v) Pointer [ 10 marks]

Question 2
Distinguish between the following, supporting your answers with skeleton program segments

(a) formal parameters and Actual parameters


(b) Procedures and functions
(c) Repeat.. Until and While Do
(d) IF and CASE structures
(e) Pass by value and Pass by reference [ 20 marks]

Question 3
Given two 2 x 2 matrices, A and B, Write a program ( using procedures and functions) that accepts the two
matrices and find their product as matrix C. [ 30 marks]

Question 4
(a) Write an algorithm that performs a sequential search on an array of items.
(b) Write a procedure that counts the number of nodes in a linked list and print the number of nodes
[20 marks]
Question 5
Assuming the following declarations
Const
N =99;
Type
Numset = set of 1..n;
Var
S : Numset;

(a) Write a procedure to build a set S of size determined by the user [ 10 marks]
(b) Search for an integer determined by the user in the set [ 10 marks]

Question 1

Define the following terms as they are used in data structures and algorithms.

(vi) Pseudocode
(vii) Algorithm
(viii) ADT
(ix) Data abstraction
(x) pointer

Question 1
(i) Define stack data structure
(ii) Describe the features/ characteristics of a stack data structure ( also look at the diagrammatic
interpretation of stacks)
Question 1
(c) Write an algorithm that performs a sequential search on an array of items.
(d) Write a procedure that counts the number of nodes in a linked list and print the number of nodes

Question 1

Given the following declaration:-

Type
Student = Record
Stud_num : integer;
Stud_name: String;
Class : String;
End;

Write procedures to perform the following:-


a) Create a file of students
b) Delete records
c) Edit records

Question 1
(i) Define recursion
(ii) Write a recursive function (fact) to calculate the factorial of a number 9n0 passed as a value
parameter.

Question 1
(i) Obtain the preoder, inorder and postorder traversal of a give tree
(ii) Define graph data structure
(iii) Find the degree and indegree of a graph
(iv) Distinguish between connected and complete graph

Question 1
Write an algorithm to build a single linked list

You might also like