Jawaharlal Nehru Technological University Hyderabad

Jawaharlal Nehru Technological University Hyderabad B.Tech II Year DATA STRUCTURES Previous Question Paper (October - 2020 - R15)

B.Tech | II Year | I | R15 | October - 2020

Answer PaperPaper Code: 123BPMaximum Marks: 75Time: 2 hours

Answer any five questions. All questions carry equal marks.

Main

115 marks
a

Distinguish between circular linked list and doubly linked list by giving one example for each.

7 marks

Answer

A Circular Linked List is a variation of a linked list where the last node points back to the first node instead of NULL, creating a continuous loop. This allows for traversal of the entire list starting from any node. An example is a round-robin task scheduler where processes are cycled through repeatedly.

A Doubly Linked List contains nodes where each node has two pointers: one to the next node and one to the previous node. This structure allows bidirectional traversal. An example is the 'Undo' functionality in a text editor, where navigating back and forth through states is required.

b

Write a C function for deleting an integer element from the singly linked list of integer elements. Assume that the singly linked list of integers is already created.

8 marks

Answer

The following C function deletes the first occurrence of a specified integer from a singly linked list:

void deleteNode(struct Node** head, int key) {
    struct Node *temp = *head, *prev;
    if (temp != NULL && temp->data == key) {
        *head = temp->next;
        free(temp);
        return;
    }
    while (temp != NULL && temp->data != key) {
        prev = temp;
        temp = temp->next;
    }
    if (temp == NULL) return;
    prev->next = temp->next;
    free(temp);
}

The function handles three cases: deleting the head node, deleting a node in the middle or end, and handling cases where the element is not found.

215 marks
a

Write a C function for inserting an integer element into a circular queue of integers. Assume array representation for the circular queue.

8 marks

Answer

Sign in to view the complete answer paper.

b

Convert the following infix expression into postfix form

a+b*c-e/f
.

7 marks

Answer

Sign in to view the complete answer paper.

3

Write a non recursive procedure for the inorder and post order traversal of a binary tree. Assume that the binary tree of elements is already created.

15 marks

Answer

Sign in to view the complete answer paper.

415 marks
a

Write heap sort algorithm for sorting a list of integers in ascending order.

8 marks

Answer

Sign in to view the complete answer paper.

b

What is the time complexity of heap sort in the worst case?

7 marks

Answer

Sign in to view the complete answer paper.

515 marks
a

Compare the performance of AVL tree with binary search tree.

8 marks

Answer

Sign in to view the complete answer paper.

b

Write the Knuth-Morris-Pratt pattern matching algorithm.

7 marks

Answer

Sign in to view the complete answer paper.

615 marks
a

Explain with an example any one method used for representing sparse matrix.

7 marks

Answer

Sign in to view the complete answer paper.

b

Write a C function for concatenating two singly linked linear lists of characters. Assume that the two singly linked lists of characters are already created.

8 marks

Answer

Sign in to view the complete answer paper.

7

Write a C program to implement stack using singly linked list.

15 marks

Answer

Sign in to view the complete answer paper.

815 marks
a

Explain with an example the adjacency matrix representation of a graph also mention its complexities.

8 marks

Answer

Sign in to view the complete answer paper.

b

Write a recursive procedure for the DFS of a graph.

7 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the question paper of DATA STRUCTURES from Jawaharlal Nehru Technological University Hyderabad for B.Tech CSE II Year I, October - 2020, R15.

For the solved question paper with answers, switch to the Answer Paper tab.

Other papers in DATA STRUCTURES

Loading Question Papers

Fetching data from database...