Question
Question 1: Multiple Choices and Short Answers [2 marks x 10 = 20 marks] 1. Which of the following is TRUE? Circle ONE . A.
Question 1: Multiple Choices and Short Answers [2 marks x 10 = 20 marks] 1. Which of the following is TRUE? Circle ONE
. A. The nodes of a linked list are allocated contiguously next to each other in memory.
B. A working linked list class must have a size attribute.
C. Inserting a new node to a linked list may require copying all existing nodes in the list to a new memory location.
D. None of the above is true.
2. Consider a circular, singly linked list with next and with both head and tail references. Which of the following operations would have a (n) worse-case runtime? Circle ALL that apply.
A. Insert at the head
B. Insert at the tail
C. Delete at the head
D. Delete at the tail
E. None of the above
3. Immediately after exiting a loop, which of the following are TRUE? Circle ALL that apply.
A. negation of loop guard
B. precondition
C. loop guard
D. loop invariant
4. Which of the following functions grows the most slowly?
Choose ONE. A. log(n0.5) B. log(n)*log(n) C. (log(n))0.5 D. n 0.5
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started