MTE Question Paper (DSA)
MTE Question Paper (DSA)
Enrolment No:
Consider a binary search algorithm on a sorted array of size 16. Determine the number
of comparisons required in the worst-case scenario to locate an element using binary
Q3 CO-3
search.
SECTION B
Design an algorithm or C program to create a linked list using the following node data:
5 → 10 → 15 → 20 → 25 and then insert a new node with the value 30 at the third
Q4 4 CO-2
position of the list.
1|Page
Consider a 2D array A[4][5] stored in memory. The base address of the array is 1000,
and each element occupies 4 bytes. Apply the concepts of row-major and column-
Q6 2*2=4 CO-1
major order to calculate the memory address of A[2][3].
Given a sorted array of integer values, analyze the problem of finding two distinct
values in the array whose sum is 90. Write a C program (not the algorithm) to solve
Q7 4 CO-2
this problem. The function should be named findsum(int arr[], int n).
SECTION-C
Imagine you are developing a software module for a basic calculator application that
processes mathematical expressions entered by users. The users will input complex
expressions in infix notation, such as arithmetic operations with parentheses and
operators.
In this scenario, a user inputs the following mathematical expression to your calculator:
(Price_A + Price_B) * (Discount_C - Discount_D) / Tax_E
CO-2,
Q8 • Here, Price_A, Price_B represent the prices of two products, Discount_C and 3+5=8
CO-3
Discount_D represent percentage discounts on two items, and Tax_E represents the
applicable tax rate.
• You are given values for each variable:
o Price_A = 3
o Price_B = 4
o Discount_C = 8
o Discount_D = 6
o Tax_E = 2
B) Your task is to convert the infix expression (Price_A + Price_B) * (Discount_C
- Discount_D) / Tax_E into postfix and then evaluate the resulting postfix
expression using a stack. Show each step of conversion and evaluation.
2|Page