Question
(TCO 6) The node of a singly linked list contains _____. one node pointer (or node reference) two node pointers (or node references) three node
(TCO 6) The node of a singly linked list contains _____.
one node pointer (or node reference) |
two node pointers (or node references) |
three node pointers (or node references) |
an array |
Flag this Question
Question 26 pts
(TCO 6) The inorder sequence of the following binary tree is _____.
37, 32, 24, 22, 20, 17 |
22, 24, 17, 32, 20, 37 |
17, 22, 20, 24, 32, 37 |
17, 20, 22, 24, 32, 37 |
Flag this Question
Question 36 pts
(TCO 6) The node of a doubly linked list contains _____.
one node pointer (or node reference) |
two node pointers (or node references) |
three node pointers (or node references) |
an array |
Flag this Question
Question 46 pts
(TCO 6) Let q be a stack. Consider the following program. q.enqueue(1); q.enqueue(2); q.dequeue(); q.enqueue(3); q.enqueue(4); q.dequeue(); int x = q.getFront(); What is the value displayed by the System.out.println statement?
1 |
2 |
3 |
4 |
Flag this Question
Question 56 pts
(TCO 6) If the numbers 9, 17, 21, and 34 are inserted, in that order in a queue, which will be the first element to be removed? _____.
9 |
17 |
21 |
34 |
Flag this Question
Question 66 pts
(TCO 6) Consider a list implemented with an array and analyze the operation method given below. What list operation does the method define? void operation(int item) { if (numberOfItems == SIZE) System.out.println("ERROR"); else { listArray[numberOfItems] = item; numberOfItems++; } }
Clear |
Remove |
Insert |
Display |
Flag this Question
Question 76 pts
(TCO 6) When designing a hash function, we try to _____ the number of collisions.
maximize |
minimize |
double |
increment |
Flag this Question
Question 86 pts
(TCO 6) This function calculates _____. long x(int n) { if (n == 1) return 1; else return n * x(n-1); }
n*(n+1)/2 |
(1+2+3+&+n)/2 |
the summation 1+2+3+ ... +n |
the factorial of n |
Flag this Question
Question 96 pts
(TCO 6) Given an array of values which initially contains 9 8 7 6 5 4 3 2 1, what does the array look like after bubble sort has executed three passes, which means that the largest three values have been moved to their correct positions in the array.
1 5 2 4 3 6 7 8 9 |
6 5 4 3 2 1 7 8 9 |
1 2 3 6 5 4 7 8 9 |
1 2 3 4 5 6 7 8 9 |
Flag this Question
Question 106 pts
(TCO 6) Suppose you are given a linked list of integers whose items are sorted. Which is the most efficient way to search the list to determine if a given value x is in the list?
Use binary search. |
Visit each item in the list sequentially until x is found or the end of the list is reached. |
Visit each item in the list sequentially until x is found or the end of the list is reached. |
Sort the linked list. |
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