Question
It's Java programming Question 1 While every recursive method has a recursive case, not every recursive method will have a base case. Group of answer
It's Java programming
Question 1
While every recursive method has a recursive case, not every recursive method will have a base case.
Group of answer choices:
True
False
Question 2
Which of the following represent good uses for recursion, rather than iterative approaches?
Group of answer choices:
- Towers of Hanoi
- Fibonacci sequence
- Traveling problems
- Factorial sequence
- Folder crawlers
- Fractals
- In a menu display/handling method, to re-display the menu
Question 3
For a specific problem, if you can think of two straightforward code solutions, one using iteration, and one using recursion, you should typically go with the recursive approach.
Group of answer choices
True
False
Question 4
Backtracking in a recursive solution is implemented using the backtrack keyword.
Group of answer choices:
True
False
Question 5
Which of these concepts is typically not associated with linked lists?
Group of answer choices:
- node class
- front node reference
- private node data
- traversing
Question 6
Memory allocation associated with adding to a linked list is less likely to fail than memory allocation associated with adding a new item to an array list.
Group of answer choices:
True
False
Question 7
Which of these should be taken into consideration when testing linked-list code?
Group of answer choices:
- empty list
- "interesting" thing at the beginning
- "interesting" thing at the end
- "interesting" thing in the middle
- list is full
Question 8
Neither arrays (and typical array algorithms) nor linked lists (and typical linked-list algorithms) use a significant amount of computer stack memory.
Group of answer choices:
True
False
Question 9
Assume no "dummy" nodes are being used. Assume we have a node reference called front. Assume nodes of type Node. Assume the list is not empty. Which of these correctly implements the addAtFront method, which is declared as follows: public void addAtFront(int value) { ... }
Group of answer choices:
- Node newNode = new Node(value); front = newNode;
- Node newNode = new Node(value); newNode.next = front; front = newNode;
- front = new Node(value);
- front = value;
Question 10
Select all the correct statements about doubly linked lists (vs. singly linked lists).
Group of answer choices:
- They typically have a "tail" or "end" reference as well as a "head" or "front" reference.
- The "I went too far" problem is less of a consideration, as you can navigate backwards with ease.
- It is not possible to "lose" parts of the list.
- They have a "prev" reference in addition to the "next" reference.
- Because of the additional references being stored, maintained, you will need two temporary variables when you add new nodes.
- When writing test cases, we need to keep in mind the "end" reference as a special case.
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