Skip to main content

Data Structures - MCQs from AMIE exams (Summer 2018)

Answer the following questions (10 x 2)

1. Binary search can be performed if data items are stored in an:
(a) unordered array
(b) ordered array
(c) unordered linked list
(d) ordered linked list

2. Strings can be defined directly by using the data type:
(a) char
(b) string
(c) String
(d) Str

3. The Linked list is preferred over arrays for the following operation:
(a) search
(b) insertion
(c) bubble-sorting
(d) heap-sorting

4. When the input size is not known in advance we prefer linked lists over arrays due to:
(a) Static memory allocation
(b) random memory allocation
(c) heap allocation
(d) dynamic memory allocation

5. What is the postfix representation of the following infix expression?
(A + B) * C – D * E / F
(a) A B + C * D E * F - /
(b) A B * C + D E * F / -
(c) A B + C – D E * F / *
(d) A B + C * D E * F / -

6. If a queue is implemented by a circular array QUEUE The number of elements in the queue if
FRONT - 10 and REAR - 3 will be (number of memory locations are 12):
(a) 3
(b) 4
(c) 5
(d) 6

7. The number of null links in a binary tree with n nodes:
(a) n + 1
(b) 2n
(c) 2n - 1
(d) n - 1

8. Assuming the height of a single node is zero the maximum possible height of a binary tree with n nodes is:
(a) ⌈log(n)⌉
(b) ⌊log(n)⌋
(c) ⌊log(n + 1)⌋ + 1
(d) n - 1

9. The maximum number of edges in a connected simple graph G = (V, E) is:
(a) |V|
(b) |V| - 1
(c) |V|(|V| - 1)/2
(c) |V|²

10. To perform computation on a sparse graph G = (P, E) we would prefer the following data structure:
(a) Adjacency Matrix
(b) Incidence Matrix
(c) Adjacency List
(d) Incidence List.

Answer

1. (b) Binary Search is a searching algorithm used in a sorted array by repeatedly dividing the search interval in half. The idea of binary search is to use the information that the array is sorted and reduce the time complexity to O(log n). 

2. (a) Declaring a string is as simple as declaring a one-dimensional array. Below is the basic syntax for declaring a string.
     char str_name[size];
In the above syntax str_name is any name given to the string variable and size is used to define the length of the string, i.e the number of characters strings will store. 

3. (b) Linked lists are often used because of their efficient insertion and deletion. They can be used to implement stacks, queues, and other abstract data types.

4. (d) A linked list is a dynamic data structure that can grow and shrink in size at runtime by allocating and deallocating memory. As a result, there is no need to specify the linked list's initial size.

5. (d) 

Concept:
() has the highest precedence
* and / has the same precedence while + and – have the same precedence
(* and /) and higher precedence than (+, -)
Associativity is left to right:

Explanation:
(A + B) * C – D * E / F
A B + * C – D * E / F
A B + C * – D * E / F
A B + C * – D E * / F
A B + C * – D E * F /
A B + C * D E * F / –

6. (d)
Case 1: Rear ≥ Front
Number of elements = Rear - Front + 1

Case 2: Front > Rear
Number of elements = N + (Rear - Front) + 1
where N = number of memory locations

7. (a) The number of null links (i.e., absent children of the nodes) in a binary tree of n nodes is (n+1).

8. (d) In a binary tree, a node can have a maximum of two children. If there are n nodes in a binary tree, the maximum height of the binary tree is n-1.

9. (c)

10. (c) Given a graph G = (V, E) the adjacency list representation consists of an array Adj of |E| elements. Adjacency lists require space Θ (|V|+|E|) and are preferable for sparse graphs with a low density of connections.

---
  • The study material for AMIE/B Tech/Junior Engineer exams is available at https://amiestudycircle.com
  • If you like the post please share your thoughts in the comment section 


Comments

Popular posts from this blog

Mechanics of Fluids (Solved Numerical Problems)

Numerical The surface Tension of water in contact with air at 20°C is 0.0725 N/m. The pressure inside a droplet of water is to be 0.02 N/cm² greater than the outside pressure. Calculate the diameter of the droplet of water. (7 marks) (AMIE Summer 2023) Solution Surface tension, σ = 0.0725 N/m Pressure intensity, P = 0.02 N/m 2 P = 4σ/d Hence, the Diameter of the dropd = 4 x 0.0725/200 = 1.45 mm Numerical Find the surface tension in a soap bubble of 40 mm diameter when the inside pressure is 2.5 N/m² above atmospheric pressure. (7 marks) (AMIE Summer 2023) Answer: 0.0125 N/m Numerical The pressure outside the droplet of water of diameter 0.04 mm is 10.32 N/cm² (atmospheric pressure). Calculate the pressure within the droplet if surface tension is given as 0.0725 N/m of water. (AMIE Summer 2023, 7 marks) Answer: 0.725 N/cm 2   Numerical An open lank contains water up to a depth of 2 m and above it an oil of specific gravity 0.9 for a depth of 1 m. Find the pressure intensity (i) at t...

Energy Systems (Solved Numerical Problems)

Wind at 1 standard atmospheric pressure and \({15^0}C\) has velocity of 15 m/s, calculate (i) the total power density in the wind stream (ii) the maximum obtainable power density (iii) a reasonably obtainable power density (iv) total power (v) torque and axial thrust Given: turbine diameter = 120 m, and turbine operating speed = 40 rpm at maximum efficiency. Propeller type wind turbine is considered. (AMIE Winter 2023) Solution For air, the value of gas constant is R = 0.287 kJ/kg.K 1 atm = 1.01325 x 105 Pa Air density \(\rho  = \frac{P}{{RT}} = \frac{{1.01325x{{10}^5}}}{{287}}(288) = 1.226\,kg/{m^3}\) Total Power \({P_{total}} = \rho A{V_1}^3/2\) Power density \(\begin{array}{l}\frac{{{P_{total}}}}{A} = \frac{1}{2}\rho {V_1}^3\\ = \frac{1}{2}(1.226){(15)^3}\\ = 2068.87{\mkern 1mu} W/{m^2}\end{array}\) Maximum power density \(\begin{array}{l}\frac{{{P_{\max }}}}{A} = \frac{8}{{27}}\rho A{V^3}_1\\ = \frac{8}{{27}}(1.226){(15)^3}\\ = 1226{\mkern 1mu} W/{m^2}\end{array}\) Assuming eff...

Design of Electrical Systems (Solved Numerical Problems)

Important note There is something wrong with this question paper. It seems that instead of "Design of Electrical Systems" the IEI has given problems from "Electrical Machines". You should raise a complaint to director_eea@ieindia.org in this regard. Numerical A 120 V DC shunt motor draws a current of 200A. The armature resistance is 0.02 ohms and the shunt field resistance is 30 ohms. Find back emf. If the lap wound armature has 90 slots with 4 conductors per slots, at what speed will the motor run when flux per pole is 0.04 Wb?​ (AMIE Summer 2023, 8 marks) Solution The back EMF (E b ) of a DC motor can be calculated using the formula: E b = V - I a R a   Given: V = 120 V I a = 200 A R a = 0.02 ohms Substituting the values into the formula: E b = 120 − 200 × 0.02 = 120 − 4​ = 116 V Now, let's calculate the speed (N) at which the motor will run using the given flux per pole (φ p ). The formula to calculate the speed of a DC motor is: N = 60×E b /(P×φ p ) Wh...