Arrays and Linked Lists - Higher Difficulty Problems

Download Q&A
Q. Given a linked list, how can you determine if it contains a cycle?
  • A. Using a hash table
  • B. Using two pointers
  • C. Using recursion
  • D. All of the above
Q. What is the space complexity of a recursive function that uses a stack to store function calls?
  • A. O(1)
  • B. O(n)
  • C. O(log n)
  • D. O(n^2)
Q. What is the space complexity of storing a linked list with n nodes?
  • A. O(1)
  • B. O(n)
  • C. O(n^2)
  • D. O(log n)
Q. What is the time complexity of merging two sorted arrays of sizes m and n?
  • A. O(m + n)
  • B. O(m * n)
  • C. O(log(m + n))
  • D. O(n)
Q. What is the worst-case time complexity of inserting an element at the beginning of a singly linked list?
  • A. O(1)
  • B. O(n)
  • C. O(log n)
  • D. O(n log n)
Q. Which of the following data structures can be used to implement a queue?
  • A. Array
  • B. Linked List
  • C. Stack
  • D. Both Array and Linked List
Showing 1 to 6 of 6 (1 Pages)
Soulshift Feedback ×

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

Not likely Very likely