JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD MCA 2022 DATA STRUCTURES AND ALGORITHMS Previous Question Paper (October/November - 2022 - R15)

MCA | 2022 | II | R15 | October/November - 2022

Answer PaperPaper Code: 821AFMaximum Marks: 75Time: 3 Hours

Answer any five questions

All questions carry equal marks

Main

115 marks
a

Briefly explain about the following Asymptotic notations.

i) Big O ii) Omega iii) Theta

8 marks

Answer

Asymptotic notations are mathematical tools used to describe the limiting behavior of a function, typically representing the time or space complexity of an algorithm.

i) Big O notation (O): Provides an asymptotic upper bound on the growth rate of a function. It represents the worst-case scenario. Formally, f(n) = O(g(n)) if there exist positive constants c and n0 such that 0 ≤ f(n) ≤ c·g(n) for all n ≥ n0.

ii) Omega notation (Ω): Provides an asymptotic lower bound on the growth rate of a function. It represents the best-case scenario. Formally, f(n) = Ω(g(n)) if there exist positive constants c and n0 such that 0 ≤ c·g(n) ≤ f(n) for all n ≥ n0.

iii) Theta notation (Θ): Provides an asymptotic tight bound on the growth rate of a function. It represents the average or exact growth rate. Formally, f(n) = Θ(g(n)) if there exist positive constants c1, c2, and n0 such that c1·g(n) ≤ f(n) ≤ c2·g(n) for all n ≥ n0.

b

Write a program to implement stack ADT using arrays.

7 marks

Answer

A stack is a Last-In-First-Out (LIFO) data structure. The following C implementation uses an array to perform push, pop, and peek operations.

#include <stdio.h>
#define MAX 100

int stack[MAX], top = -1;

void push(int val) {
    if (top == MAX - 1) printf("Stack Overflow\n");
    else stack[++top] = val;
}

int pop() {
    if (top == -1) { printf("Stack Underflow\n"); return -1; }
    return stack[top--];
}

void display() {
    for(int i = top; i >= 0; i--) printf("%d ", stack[i]);
    printf("\n");
}

int main() {
    push(10); push(20);
    display();
    printf("Popped: %d\n", pop());
    return 0;
}
2

Briefly explain the following Doubly Linked List operations

15 marks
a

Insertion

7 marks

Answer

Sign in to view the complete answer paper.

b

Deletion

8 marks

Answer

Sign in to view the complete answer paper.

315 marks
a

Briefly explain about Union and Find operations.

8 marks

Answer

Sign in to view the complete answer paper.

b

Write a short note on priority Queue.

7 marks

Answer

Sign in to view the complete answer paper.

4

Write and explain the DFS algorithm with an example.

15 marks

Answer

Sign in to view the complete answer paper.

515 marks
a

Discuss about Binary Search with an example.

7 marks

Answer

Sign in to view the complete answer paper.

b

Briefly explain the Linear Probing with an example.

8 marks

Answer

Sign in to view the complete answer paper.

6

Explain the following sorting techniques

15 marks
a

Radix Sort

7 marks

Answer

Sign in to view the complete answer paper.

b

Merge sort

8 marks

Answer

Sign in to view the complete answer paper.

715 marks
a

What is Splay Tree? Explain the delete operation on Splay Tree.

8 marks

Answer

Sign in to view the complete answer paper.

b

Construct the B - Tree of order 2 for the following data {5, 2, 6, 3, 9, 1, 4, 8, 7}

7 marks

Answer

Sign in to view the complete answer paper.

815 marks
a

Write and explain the Kruskal’s Algorithm for Minimum cost Spanning tree.

7 marks

Answer

Sign in to view the complete answer paper.

b

Write a short note on Standard Tries, Compressed Tries and Suffix tries.

8 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the solved question paper with answers of DATA STRUCTURES AND ALGORITHMS from JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD for MCA 2022 II, October/November - 2022, R15.

For the question paper without answers, switch to the Question Paper tab.

Other papers in DATA STRUCTURES AND ALGORITHMS

Loading Question Papers

Fetching data from database...