Arrays and Linked Lists - Complexity Analysis - Case Studies

Download Q&A
Q. In a binary tree, what is the time complexity of traversing all nodes using in-order traversal?
  • A. O(1)
  • B. O(n)
  • C. O(log n)
  • D. O(n log n)
Q. In a doubly linked list, what is the time complexity of deleting a node given a pointer to that node?
  • A. O(1)
  • B. O(n)
  • C. O(log n)
  • D. O(n^2)
Q. What is the average time complexity of searching for an element in an unsorted array?
  • A. O(1)
  • B. O(n)
  • C. O(log n)
  • D. O(n^2)
Q. What is the space complexity of a linked list?
  • A. O(1)
  • B. O(n)
  • C. O(log n)
  • D. O(n^2)
Q. What is the space complexity of a recursive function that uses a stack to perform depth-first search on a graph?
  • A. O(1)
  • B. O(n)
  • C. O(log n)
  • D. O(n^2)
Q. What is the time complexity of deleting an element from a queue implemented using a linked list?
  • A. O(1)
  • B. O(n)
  • C. O(log n)
  • D. O(n^2)
Q. What is the worst-case time complexity for searching an element in an unsorted linked list?
  • A. O(1)
  • B. O(n)
  • C. O(log n)
  • D. O(n^2)
Q. Which data structure allows for FIFO (First In First Out) access?
  • A. Stack
  • B. Queue
  • C. Array
  • D. Linked List
Q. Which of the following operations has the worst time complexity in a singly linked list?
  • A. Accessing an element
  • B. Inserting an element
  • C. Deleting an element
  • D. Traversing the list
Showing 1 to 9 of 9 (1 Pages)
Soulshift Feedback ×

On a scale of 0–10, how likely are you to recommend The Soulshift Academy?

Not likely Very likely