CAT1 2020-21 (1)
CAT1 2020-21 (1)
Instructions
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
(10 Marks)
Question 3
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;
(25 Marks)
3
Question 5
Consider the binary tree given below to answer the questions