0% found this document useful (0 votes)
10 views4 pages

CAT1 2020-21 (1)

The document is a Continuous Assessment Test for the B.Sc. Degree Programme in Computer Science at The Open University of Sri Lanka, focusing on Data Structures and Algorithms. It includes various questions on concepts such as linked lists, queues, and binary trees, requiring students to fill in blanks, state true or false, and write code snippets. The test is scheduled for January 7, 2022, and has strict submission guidelines regarding timing and email communication.

Uploaded by

maniduonlinejobs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views4 pages

CAT1 2020-21 (1)

The document is a Continuous Assessment Test for the B.Sc. Degree Programme in Computer Science at The Open University of Sri Lanka, focusing on Data Structures and Algorithms. It includes various questions on concepts such as linked lists, queues, and binary trees, requiring students to fill in blanks, state true or false, and write code snippets. The test is scheduled for January 7, 2022, and has strict submission guidelines regarding timing and email communication.

Uploaded by

maniduonlinejobs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

THE OPEN UNIVERSITY OF SRI LANKA

B.Sc. DEGREE PROGRAMME: LEVEL 03

DEPARTMENT OF COMPUTER SCIENCE


CSU3302 – DATA STRUCTURES AND ALGORITHMS

CONTINOUS ASSESSMENT TEST 1 – 2020/2021


DURATION: One Hour only

Date: 07 .01.2022 Time: 4.15 p.m. – 5.15 p.m.

Instructions

Answer All Questions.


You must follow the instructions given in the learnousl to do the Test.

You are free to type/write your answers and send it to the email address –
[email protected] as mentioned in the instructions. Please send the email using your
university email address.

E-mails receive after 5.20p.m. are not considered for marking and you will receive 0 (zero)
marks. Sending more than one email leads to deduct marks.

Question 1
Fill in the blanks with appropriate terms.
a) ………………………. defines how data represent in a computer and its associate
operations for efficient usage
b) Data types such as …………. or …………... can be considered as simple data structures
c) In C language, basically there are two types of functions, namely …………………… and
…………………………….
d) There are two fields in the linked lists namely, information field and the link field. The link
field of the last node contains special value called ……………
e) A linked list, which allows bi-directional traversing is known as ……………………….
f) A tree is a ……………………………… data structure in which items are arranged in
levels.
g) LIFO stands for ………………………...
h) A ………………………... over comes the problem of unutilized space in linear queues
implemented as arrays.
i) The three places, where a new node can be inserted into a linked list are
1. ……………………. 2. ……………………. 3. ……………………
j) The two basic operations associated with a Stack is known as …………………. and
………………...

1
(15 Marks)

Question 2

State whether the following statements are true or false


a) The number of sub trees of a node is called as it’s degree.
b) Queue uses the FIFO principle.
c) Stack data structure allows deleting data items from the end called front and inserting to the
other end called rare.
d) Doubly linked list does not allow bi-directional traversing.
e) If the elements ‘A’, ‘B’, ‘C’, and ‘D’ are added to a stack, then the order for the removal
from the stack is same as ‘A’, ‘B’, ‘C’, ‘D’.
f) Logical and physical ordering of data items in a linked list (pointer implementation). need
not be the same.
g) Variables which are visible to the entire program, are known as local variables.
h) (A+B*C) is an infix expression
i) In an array implementation of a list, a fixed set of nodes should be declared at the
beginning of the execution of the list, irrespective of their usage.
j) In a circular linked list, the link field of the last node contains NULL pointer.

(10 Marks)

Question 3

Pointer implementation of Linked list can be declared as follows.

struct Llist
{
char name;
Llist *next;
};
By using the above declaration, answer the following questions.
a) Write the statement to declare a node variable using the above declaration
b) Write the statement to allocate the memory to a new node
c) Write the function named getnode() which returns a newnode using the statements written in
a) and b)
d) Write the function to create the list and insert “A’ as the first element of the list
e) Write the function to insert an element at the beginning of the list
(25 Marks)

2
Question 4
Using following declaration of a queue, answer the questions below.
#define Qsize 25
struct myqueue
{
int front;
int rear;
int info[Qsize];
};
struct myqueue Qnode;

a) What is the implementation methos of the queue mentioned above


b) What are the terms used for the basic operations of a queue
c) Consider the first location and the last location of the array mentioned above as ‘front’ and
‘rear’ respectively.
i) Write the statement to check the queue overflow condition
ii) Write the statement to check the queue underflow condition
d) Write the function to delete an item from the queue
e) Write a statement to declare a structure for pointer implementation of queue

(25 Marks)

3
Question 5
Consider the binary tree given below to answer the questions

a) How many nodes and edges in the above tree?


b) What is the root node of the above binary tree?
c) What are the leaf nodes?
d) Write the sibling and parent node of node ‘38’
e) What is the level of node ‘12’
f) What is the height of the tree?
g) Is this tree a strictly binary tree?
h) Which nodes are rooted its left and right sub trees?
i) Mentioned the degrees of nodes in level 2
j) Write the path from root node to node ‘15’
k) What would be the output when this tree traverse in three different traversal methods.
(25 Marks)

You might also like