0% found this document useful (0 votes)
21 views3 pages

CSET243-R23 Questionpaper

The document outlines the structure and instructions for an end-term examination for a Data Structures course, including guidelines for students and various sections of questions covering topics such as complexity, data structures, algorithms, and tree traversal. It includes specific questions related to stacks, queues, graphs, hash tables, binary trees, heaps, and AVL trees, along with instructions for writing pseudocode and demonstrating algorithms. The exam is designed for B. Tech 2nd year students and consists of multiple sections with varying marks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
21 views3 pages

CSET243-R23 Questionpaper

The document outlines the structure and instructions for an end-term examination for a Data Structures course, including guidelines for students and various sections of questions covering topics such as complexity, data structures, algorithms, and tree traversal. It includes specific questions related to stacks, queues, graphs, hash tables, binary trees, heaps, and AVL trees, along with instructions for writing pseudocode and demonstrating algorithms. The exam is designed for B. Tech 2nd year students and consists of multiple sections with varying marks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 3
+ OE NNERT UNIVER SETY THE TIMES GROUP Enrolment No: Name of Student Department/ School: END-TERM EXAMINATION, ODD SEMESTER DECEMBER 2024 COURSE CODE: CSET243 MAX. DURATION: 2 HRS COURSE NAME: Data Structures Using C++ PROGRAM: B. Tech 2™ Yr TOTAL MARKS: 40 @Txlels|™|selalelel»flelale GENERAL INSTRUCTIONS: - 1. Do not write anything on the question paper except name, enrolment number and department/school. 2. Carrying mobile phones, smartwatches and any other non-permissible materials in the examination hall is an act of UFM. COURSE INSTRUCTIONS: a) Read all questions carefully: Ensure you understand what is being asked before you start solving, b) For problems requiring algorithm design, explain your approach clearly in step wise manner. <) Manage your time: Allocate time to each section based on marks and complexity. SECTION A [5Q x 2 Marks = 10 Marks] Al) Answer the following questions in relation with complexity: [0.5+0.5+1=2 Marks] (a) Which asymptotic notation represents the Best case Complexity (b) Worst case complexity of search operation on BST is (<) We have a complexity function f(n) = n? +n? +3n +4. Where f(n) = O(g(n)) iff for some constants ¢ and no, f(n) $ cg(n) for all n > no. ‘A2) Consider the following sequence of operations on an empty stack: [1#0.5+0.5=2 Marks] push (54); push(52); pop(); push(55); push(62); s = pop(); Consider the following sequence of operations on an empty queue: enqueue (21); enqueue (24); dequeue (); enqueue (28); enqueue (32); q = dequeue (); (a) Find the value of s+. (b) Write Overflow condition for Stack (<)__ Write Underflow condition for queue 3) Let we have a sorted list of 6 elements present in the form of linked list. [0.5+0.5+1=2 Marks] 2->5->7->9->10->12 Which algorithm will be best approach to search an element over the list. What is the worst case complexity to search an element over this list. Write the algorithm/pseudocode to perform search over the list. Aa) Consider the graph given in Figure 1 below: [1#1=2 Marks} Page 1 of 3 AS) 81) 82) 3) Ba) eo. 00 eo Figure 1: Undirected Graph {a) Represent the graph using an incidence matrix. {b) Perform a Depth-First Search traversal on the graph. Given the following hash table with a size of 10. Use division/modulo method to store keys over the hash table. The table has been populated with keys 23, 33, 43, 53, 63, and 73. Apply quadratic probing method to avoid collision situation. After inserting all the keys, show the contents of hash table. [2 Marks} SECTION B [5Q x 4 Marks = 20 Marks] Consider the following arithmetic expression P, written in postfix notation: [2+2 =4 Marks] P:12,7,3,-,/,2,1,5,4,%) + (a) Translate P into its equivalent infix notation. (b) Evaluate the postfix notation. Imagine you are a software engineer working on a project that requires the implementation of a basic organizational hierarchy. The company structure is managed as a binary tree, where each node represents an employee, with the root node as the CEO. Each employee can have at most two direct reports. To effectively organize and traverse this structure, you are given the hierarchical orderings from two different department reports: {a) Pre-order traversal (preliminary report): This traversal represents the order in which the CEO met with each employee for strategic discussions. The sequence is as follows: Preorder: F, A, E, K, C, D,H, G, B {b) In-order traversal (daily report): This sequence represents how employees are organized within their respective teams based on daily operations. The structure follows: inorder: E, A, C, K, F, H, 0, B, G Draw the binary tree representing the organizational structure. [4 Marks] You are given an unsorted array of integer [242-4 Marks] arr = (82, 90, 10, 12, 15, 77, 55, 23) {a) Explain the steps in form of heap tree required to sort this array in ascending order using the Heap Sort algorithm. Specifically, describe how you will build a max heap from this array and then use the Heapify method to sort it. (b) Write the pseudocode for the Heapify function used in Heap Sort, which maintains the max- heap property by ensuring the largest element is at the root. Note: Simulate the Heap Sort process by showing the array at each step. Formulate an algorithm to delete a specified node from a Binary Search Tree (BST), covering all possible scenarios. Additionally, demonstrate the algorithm by removing the node with the value 50 from the provided BST (Figure 2). [2#2=4 Marks] Page 20f3 ‘+ Figure 2: Binary Search Tree BS) Whaat is the significance of Priority queue order simple queue. Write algorithm/pseudocodes of Enqueue and Dequeue operations of queue. [1#1.5+1.5=4 Marks] SECTION C [2x5 Marks = 10 Marks] C1) Consider a company conducting interviews for multiple candidates. Each candidate’s merit is assessed based on a dynamically varying score that depends on multiple attributes: Experience, Skills, and Interview Performance. Each candidate’s score is recalculated as: [2+1+2=5 Marks] score = 2 experience + 3 skills + 5 « interview performance Below is the initial hash map representing each candidate’s attributes: ! Table 1: Candidate Performance | Candidate ID | Experience | Skills | Interview Performance | Initial Score Ci 5 8 6 4 c2 3 6 7 59 C3 7 9 5 66 C4 4 7 8 69 CS 6 5 | E__ are (@) Construct a max-heap based on the initial scores of the candidates. (b) Candidate C2 gains additional points in experience, raising their experience level from 3 to 6. Recalculate C2’s score and update the max-heap to reflect this change. (©) Afier updating the heap, the candidate with the highest score declines the offer due to personal reasons and is thus disqualified. Remove this candidate from the max-heap and update the heap structure accordingly. (2) Construct an AVL tree by inserting the following sequence of integers, one by one, while maintaining the balance properties of an AVL tree: [5 Marks] 50, 30, 70, 10, 40, 60, 80, 20, 35, 65, 85 For each insertion, perform any necessary rotations to ensure the tree remains balanced. Show the tree structure after each insertion, indicating any rotations that occurred, and explain why each rotation was needed Page 3 of 3

You might also like