Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 2 MCQs Introduction to Array Concepts

INT322 — Computing System And Technologies 60 questions. Pick an option to check it.

Read the notes Subjective questions

0 of 60 answered 0 right 0 wrong , 60 left

  1. Question 1 of 60 Definition and initialization of arrays Easy

    What is an array?

  2. Question 2 of 60 Memory representation of one-dimensional arrays Easy

    How are the elements of a one-dimensional array normally stored in memory?

  3. Question 3 of 60 Array traversal Easy

    What does traversing an array mean?

  4. Question 4 of 60 Array insertion Easy

    When an element is inserted at the beginning of an array, what may happen to the existing elements?

  5. Question 5 of 60 Array deletion Easy

    After deleting an element from the middle of an array, what is commonly done?

  6. Question 6 of 60 Linear search Easy

    How does linear search find a target value?

  7. Question 7 of 60 Binary search Easy

    What condition is normally required before binary search can be used on an array?

  8. Question 8 of 60 Bubble sort Easy

    What does bubble sort repeatedly compare?

  9. Question 9 of 60 Complexity analysis of array operations Easy

    What is the typical time complexity of accessing an array element by its index?

  10. Question 10 of 60 Definition and operations of stacks Easy

    Which access rule does a stack follow?

  11. Question 11 of 60 Stack traversal Easy

    What does stack traversal involve?

  12. Question 12 of 60 Push operation Easy

    What does the push operation do?

  13. Question 13 of 60 Pop operation Easy

    What does the pop operation do?

  14. Question 14 of 60 Stack underflow and overflow conditions Easy

    When does stack underflow occur?

  15. Question 15 of 60 Definition and operations of queues Easy

    Which access rule does a queue follow?

  16. Question 16 of 60 Queue traversal Easy

    In which direction are queue elements commonly traversed?

  17. Question 17 of 60 ENQ operation Easy

    What does the ENQ operation normally do in a queue?

  18. Question 18 of 60 DEQ operation Easy

    What does the DEQ operation normally do in a queue?

  19. Question 19 of 60 Queue underflow and overflow conditions Easy

    When does queue overflow occur in a fixed-size queue?

  20. Question 20 of 60 Stack underflow and overflow conditions Easy

    When does stack overflow occur in a fixed-size stack?

  21. Question 21 of 60 Definition and initialization of arrays Medium

    In a zero-indexed language, an integer array is initialized as A = [7, 14, 21, 28, 35]. Which expression accesses the value 28?

  22. Question 22 of 60 Memory representation of one-dimensional arrays Medium

    An integer array begins at address 1000, and each element occupies 4 bytes. What is the address of A[6] if indexing starts at zero?

  23. Question 23 of 60 Array traversal Medium

    Which loop correctly visits every element of a zero-indexed array A containing n elements exactly once?

  24. Question 24 of 60 Array insertion Medium

    The array [10, 20, 30, 40, 50] has one unused position at the end. After inserting 25 at index 2, what is the resulting array?

  25. Question 25 of 60 Array deletion Medium

    The element at index 1 is deleted from [5, 10, 15, 20, 25], and remaining elements are shifted left. What is the logical array afterward?

  26. Question 26 of 60 Linear search Medium

    A linear search examines [12, 7, 19, 4, 15] from left to right. How many comparisons are required to find 4?

  27. Question 27 of 60 Binary search Medium

    Binary search is used on [3, 8, 12, 17, 25, 31, 40] to find 31. Using the middle index rounded down, which values are compared with the target?

  28. Question 28 of 60 Bubble sort Medium

    Using ascending bubble sort, what is the array after one complete left-to-right pass over [5, 1, 4, 2]?

  29. Question 29 of 60 Complexity analysis of array operations Medium

    An element is inserted at the beginning of a full logical array that has spare physical capacity. What is the worst-case time complexity of the insertion?

  30. Question 30 of 60 Definition and operations of stacks Medium

    A stack receives push(6), push(9), pop(), and push(12). Which value is now at the top?

  31. Question 31 of 60 Stack traversal Medium

    A stack contains A, B, C, and D, where D is the top. In which order are elements encountered when traversing from top to bottom?

  32. Question 32 of 60 Push operation Medium

    An array-based stack of capacity 6 uses top = -1 when empty. If it currently contains four elements, what is top immediately after one valid push?

  33. Question 33 of 60 Pop operation Medium

    An array-based stack is [11, 22, 33, 44] with top = 3. What does one pop return, and what is the new value of top?

  34. Question 34 of 60 Stack underflow and overflow conditions Medium

    For an array-based stack of capacity 8 using zero-based indexing and top = -1 for an empty stack, which pair correctly identifies underflow and overflow checks?

  35. Question 35 of 60 Definition and operations of queues Medium

    An initially empty queue performs ENQ(4), ENQ(7), DEQ(), and ENQ(9). What are its contents from front to rear?

  36. Question 36 of 60 Queue traversal Medium

    A circular queue of capacity 6 has front = 4, rear = 1, and occupied indices 4, 5, 0, 1. Which index order correctly traverses the queue?

  37. Question 37 of 60 ENQ operation Medium

    A circular queue has capacity 5, rear = 3, and is not full. At which index will the next enqueued element be placed?

  38. Question 38 of 60 DEQ operation Medium

    A circular queue of capacity 7 has front = 5 and contains more than one element. After one dequeue, what is the new value of front?

  39. Question 39 of 60 Queue underflow and overflow conditions Medium

    In a circular queue of capacity 6, which condition indicates that the queue is full when front and rear are valid element indices?

  40. Question 40 of 60 Binary search Medium

    A sorted array contains 128 distinct elements. In the worst case, at most how many comparisons are needed for a successful binary search?

  41. Question 41 of 60 Definition and initialization of arrays Hard

    In C11, the following declaration and update are executed: int a[8] = { [2] = 5, [5] = 9 }; a[2] += a[0] + a[5];. What is (a[0], a[2], a[5], a[7]) afterward?

  42. Question 42 of 60 Memory representation of one-dimensional arrays Hard

    An array has base address , lower index bound , and element width bytes. Using contiguous row-major storage, what is the address of A[7]?

  43. Question 43 of 60 Array traversal Hard

    Consider for (i = 0; i < n; i++) if (A[i] < 0) { shift A[i+1..n-1] one place left; n--; }. If the initial logical array is [2, -1, -3, 4, -5], what logical array remains?

  44. Question 44 of 60 Array insertion Hard

    A zero-indexed array has length n, spare capacity, and a new value x must be inserted stably at index p. Which operation preserves every existing element?

  45. Question 45 of 60 Array deletion Hard

    A stable deletion from index p shifts all later elements left. Starting with length , delete index , then delete index from the resulting array, where and . How many element-to-element assignments are performed?

  46. Question 46 of 60 Linear search Hard

    A sentinel search for x in a nonempty array executes last=A[n-1]; A[n-1]=x; i=0; while (A[i]!=x) i++; A[n-1]=last;. Which condition correctly determines whether x was originally present?

  47. Question 47 of 60 Binary search Hard

    The following half-open binary search is applied to [1, 3, 3, 3, 8]: low=0; high=n; while (low<high) { mid=low+(high-low)/2; if (A[mid]<x) low=mid+1; else high=mid; }. What values are returned for x=3 and x=4, respectively?

  48. Question 48 of 60 Bubble sort Hard

    An optimized bubble sort runs passes starting at pass=0, compares indices j and j+1 for j=0,...,n-2-pass, and stops after a pass with no swaps. For [1, 2, 4, 3, 5], how many comparisons and swaps occur?

  49. Question 49 of 60 Complexity analysis of array operations Hard

    A sorted array is built by inserting keys supplied in strictly descending order. Each insertion position is found by binary search, after which elements are shifted to preserve order. What are the asymptotic costs?

  50. Question 50 of 60 Definition and operations of stacks Hard

    The values 1, 2, 3, 4 are pushed onto one initially empty stack in that order, with pop operations allowed between pushes. Which complete pop sequence is impossible?

  51. Question 51 of 60 Stack traversal Hard

    A stack initially contains A, B, C, D from top to bottom. A recursive procedure pops x, recursively processes the remaining stack, outputs x, and then pushes x back. What is the output order and final stack order?

  52. Question 52 of 60 Push operation Hard

    An array stack of capacity C uses top=-1 when empty. Which guarded push operation correctly inserts x without an out-of-bounds write?

  53. Question 53 of 60 Pop operation Hard

    For a nonempty linked stack whose top points to the first node, which pop sequence returns the top value, updates the stack, and avoids use-after-free?

  54. Question 54 of 60 Stack underflow and overflow conditions Hard

    Two stacks share an array of size N. Stack 1 grows upward with top1=-1 initially, while stack 2 grows downward with top2=N initially. Which condition means that a subsequent push to either stack would overflow?

  55. Question 55 of 60 Definition and operations of queues Hard

    Starting with an empty FIFO queue, execute ENQ(A), ENQ(B), ENQ(C), DEQ(), ENQ(D), ENQ(E), DEQ(), DEQ(), ENQ(F). Then execute x=DEQ(); ENQ(x); y=DEQ();. What is y, and what remains from front to rear?

  56. Question 56 of 60 Queue traversal Hard

    A circular queue uses an array of size 8, with front and rear both pointing to occupied endpoints. If front=6 and rear=2, which indices are visited in FIFO order?

  57. Question 57 of 60 ENQ operation Hard

    A circular queue of array size N leaves one slot unused. front points to the first element and rear points to the next insertion slot. Which guarded ENQ(x) operation is correct?

  58. Question 58 of 60 DEQ operation Hard

    A circular queue of size 6 uses front for the first element and rear for the next free slot. It has front=5, rear=1, Q[5]=P, and Q[0]=Q. What does one DEQ return, and what is the new front?

  59. Question 59 of 60 Queue underflow and overflow conditions Hard

    A circular queue uses an array of size 8, leaves one slot unused, and represents emptiness by front==rear. If front=3 and rear=2, which description is correct?

  60. Question 60 of 60 Complexity analysis of array operations Hard

    A dynamic array starts empty and doubles its capacity whenever full. After append operations, all elements are deleted one at a time from the front, preserving order by shifting. What are the total append cost, total deletion cost, and peak capacity?

That's unit 2

Answer a few questions and your score shows up here.