0% found this document useful (0 votes)
27 views5 pages

BCA3CC14 - Data Structure Using C

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)
27 views5 pages

BCA3CC14 - Data Structure Using C

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/ 5

Professional Course Examination, January 2021

(3rd Semester)
BACHELOR OF COMPUTER APPLICATIONS Paper
No.: BCA/3/CC/14
(Data Structure using C)

Full Marks: 75
Time: 3 hours
(PART: A-OBJECTIVE)
(Marks: 25)

The figures in the margin indicate full marks for the questions

SECTION-A

(Marks: 15)

I. Tick (√) the correct answer in the brackets provided: 1x10=10

a) Which of the following is a non-primitive data structure?


(i) int
(ii) double
(iii) char
(iv) arrays
b) The process of allocating memory at run time is known as-
(i) Virtual memory
(ii) Static memory allocation
(iii) Dynamic memory allocation
(iv) Hybrid memory allocation
c) Stack is also called--
(i) FIFO data structure
(ii) LIFO data structure
(iii) LILO data structure
(iv) FIFL data structure
d) In a double ended queue, nodes can be removed -
(i) from the front only
(ii) from the rear only
(iii) both from the front and rear
(iv) based on their priority
e) What is the worst-case complexity of Bubble sort algorithm?
(i) O(n2)
(ii) O(n)
(iii) O(n3)
(iv) O(logn)
f) In binary search, the element to search is compared with element present at-
(i) The left
(ii) The right
(iii) The top
(iv) The center
g) If each node in the linked list has only one link, it is called-
(i) Singly linked list
(ii) Circular linked list
(iii) Doubly linked list
(iv) Doubly circular linked list
h) In a linked list, if the first node pointer first is equal to NULL, it means-
(i) The linked list is empty
(ii) There is only one node in the linked list
(iii) There is more than one node in the linked list
(iv) The linked list is full
i) Which of the following in not true for a Graph?
(i) It is a non-linear data structure
(ii) It is a collection of vertices called nodes and edges
(iii) It is a Tree
(iv) It denoted by G = (V, E)
j) A leaf node in a Tree is-
(i) The internal nodes
(ii) The root node
(iii) A node with a degree of zero
(iv) A node with a degree of three

II. State whether the following statements are True(T) or False (F) by putting a Tick (√) mark
in the brackets provided: 1x5=5

(a) Unary operator *(asterisk) is known as dereferencing operator. (T/F)


(b) In a stack, if top == -1, it means stack underflow. (T/F)
(c) Binary search requires that the list of elements be in unsorted order.(T/F)
(d) A stack can be implemented using linked list functions insertFront() and
deleteRear(). (T/F)
(e) External nodes in a tree is the NULL link of any node in a tree. (T/F)
SECTION – B

(Marks: 10)

III. Answer the following questions: (2x5=10)

1. (a) Differentiate between Structures and Unions.


OR
(b) Distinguish between malloc() and calloc() function.

2. (a) What is a recursive function?


OR
(b) Write any two applications of queue.

3. (a) What is searching in the context of data structure?


OR
(b) What is sorting in the context of data structure?

4. (a) What is a linked list?


OR
(b) What are the advantages of linked list?

5.(a) What is a binary tree?


OR
(b) What is a graph?
PART: B-DESCRIPTIVE

(Marks: 50)

The figures in the margin indicate full marks for the questions

1. (a) What are different types of data structure? Explain by giving a suitable example. (5)
(b) Explain the operations that can be performed on various data structures. (5)
OR
(c) Write any five advantages of pointers. (6)
(d) Explain the format for declaration and initialization of pointer variable. (4)

2. (a) Write a C program to calculate recursive factorial of a given number. (5)


(b) Obtain the prefix expression for the following infix expression. Write and explain each
step for your conversion. (5)
((X*(Y+Z)*W)^K–P)
OR
(c) Write a C recursive program to calculate the Fibonacci sequence of length ‘n’. (4)
(d) Give the tracing to evaluate the following postfix expression-
PQR–S*+T^U+
corresponding to the infix expression ( ( P + ( Q – R ) * S ) ^ T + U ) with following values
assigned: P=5, Q=2, R=4, E=1, F=8 (6)

3. (a) Write a C program to implement linear search using array. (4)


(b) Write a C program to sort ‘n’ elements in an array using Insertion sort. (6)
OR
(c) Write a C program to implement Binary search using array. (4)
(d) Write a C program to sort ‘n’ elements in an array using Bubble sort. (6)

4. (a) Consider a singly linked list with four items. Write the steps for inserting a new node at
the front-end. (5)
(b) Write a C function to insert a node in a doubly linked list from the rear-end. (5)
OR
(c) Consider a circular linked list with four items. Write the steps for inserting an item at
the front-end. (5)
(d) Write a C function to delete a node in a singly linked list from the front-end. (5)

5. (a) Traverse the following graph by breadth-first search and print all the vertices
reachable from start vertex 0. Resolve ties by the vertex ascending order. (7)
(b) Traverse the following tree using In-order traversal methods. (3)

OR

OR

(c) Traverse the following graph by depth-first search and print all the vertices reachable
from start vertex 0. Resolve ties by the vertex ascending order. (7)

(d) Traverse the following tree using post-order traversal methods. (3)

(4)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy