程序代写案例-W21 CS

欢迎使用51辅导,51作业君孵化低价透明的学长辅导平台,服务保持优质,平均费用压低50%以上! 51fudao.top
2021/2/21 Practice Exam with Proctorio 1 (Remotely Proctored): W21 CS F001C ADV DATA STRUCT/ALGORMS JAVA 01W Mazloom 30400
https://foothillcollege.instructure.com/courses/15985/quizzes/166256 1/11
Practice Exam with Proctorio 1 (Remotely Proctored)
截⽌时间 2⽉25⽇ 23:59 得分 2.25 问题 9
可⽤ 2⽉14⽇ 7:00 ⾄ 2⽉25⽇ 23:59 12 天 时间限制 21 分钟
允许的尝试次数 3
说明
The exams will be remotely proctored, so allow a few extra minutes to get setup. Have your ID ready and
have a web cam and microphone working before you begin.
Practice taking the exam using Proctorio.
By setting up and completing this practice exam before the due date you will receive points toward the
Exam section for your attempt.
The goal is for you to familiarize yourself with the the format of the Midterm and Final exams. By no
means are the questions comprehensive or representative of all the topics covered by the exam*.
*Note: as this practice is provided prior to the Midterm exam, the questions cover a portion of the topics
prior to the Midterm.
This practice exam will be open up prior to the Midterm exam. Once you begin, you will have a specific #
minutes (see next paragraph) to complete. If you do not submit before that time your incomplete exam
will be automatically submitted as is.
Once you start the actual Midterm exam, please complete it within 75 minutes (21 MINUTES IN
PRACTICE EXAM). You are not authorized to take the Midterm exam test in multiple sessions, so do
not start it unless you have protected time in which to take the test. (Practice exam can be taken twice
in different sessions.)
You can look at lectures or texts and even use your compiler, but you may not consult any other
individuals or non-course web-sites for help.
Multiple choice questions with square check-boxes may have more than one correct answer. Multiple
choice questions with round radio-buttons have only one correct answer. Always refer to the problem
description for further clarification(s).
Any code fragments you are asked to analyze are assumed to be contained in a program that has all the
necessary variables defined and/or assigned. The exception is if the method or class was part of a larger
lecture material, which you used to implement one or more of your projects.
None of these questions is a trick. They pose straightforward questions about programming and
language concepts and rules taught in this course.
2021/2/21 Practice Exam with Proctorio 1 (Remotely Proctored): W21 CS F001C ADV DATA STRUCT/ALGORMS JAVA 01W Mazloom 30400
https://foothillcollege.instructure.com/courses/15985/quizzes/166256 2/11
尝试历史记录
尝试 时间 分数
最新 尝试 1 6 分钟 0.63,满分 2.25 分
此尝试的分数: 0.63,满分 2.25 分
提交时间 2⽉21⽇ 5:28
此尝试进⾏了 6 分钟。
再次参加测验
0 / 0.25 分
问题 1
2021/2/21 Practice Exam with Proctorio 1 (Remotely Proctored): W21 CS F001C ADV DATA STRUCT/ALGORMS JAVA 01W Mazloom 30400
https://foothillcollege.instructure.com/courses/15985/quizzes/166256 3/11
This question is based on our implementation of ArrayLists, which is typical.
Recall that our implementation, internally, calls a helper
method ensureCapacity() whenever extra storage space is needed. Some
details of this operation are universal for theoretical reasons. We may not
have covered the theoretical reasons yet, but we have studied the
implementation of ensureCapacity(). Consider the following scenario.
The Current State of One Particular ArrayList
The capacity of a particular ArrayList is 100 at some point in time. At that
same time, there happens to be 98 elements of client data in the list.
The Next Operation Requested of this ArrayList
From that state, a client add()s five data items to the list.
The Internal Reaction of the ArrayList
This will certainly require an increase in the list's capacity. The question is
about what actually happens internally in the time interval during which the
totality of of these five add()s are executed.
There will be one call to ensureCapacity().正确回答
There will be five calls to ensureCapacity().
There will be three calls to ensureCapacity().
There will be no calls to ensureCapacity().您已回答
Ensure capacity doubles the allocation each time, so after we
reach the limit of 100, it will double to 200, removing the need for
more than one call to ensureCapacity() in the five add()
operations under consideration. One call is all that will occur.
2021/2/21 Practice Exam with Proctorio 1 (Remotely Proctored): W21 CS F001C ADV DATA STRUCT/ALGORMS JAVA 01W Mazloom 30400
https://foothillcollege.instructure.com/courses/15985/quizzes/166256 4/11
0.25 / 0.25 分
问题 2
Generic classes will issue a fatal compiler error if a type parameter is
missing.
True
False 正确!
The type parameter is optional. Let's assume we have a
parameterized class Box if we create a reference without
specifying the type then it defaults to a raw type which is
the Object class. When we do not specify the parameter we lose
the advantage of compiler type checks!
0.13 / 0.25 分
问题 3
Consider properties of a BST vs. a General Tree. Match the properties described
with appropriate tree type.
Choices - use a choice only once
A. BST only
B. Both
C. Neither
D. General Tree only
Match each of the following to a choice
2021/2/21 Practice Exam with Proctorio 1 (Remotely Proctored): W21 CS F001C ADV DATA STRUCT/ALGORMS JAVA 01W Mazloom 30400
https://foothillcollege.instructure.com/courses/15985/quizzes/166256 5/11
答案 1:
答案 2:
答案 3:
答案 4:
g
Match each of the following to a choice
1.
Allows the removal of any single data Node without
forcing the removal of other nodes.
BST only
2.
For a fixed height, say 5, it can hold potentially
millions of nodes.
[选择]
3.
Is an efficient way to store data when O(1), i.e.,
constant, search time is needed.
Both
4. Can handle a pre-order traversal. [选择]
BST only 正确!
General Tree only 正确!
Both 您已回答
Neither 正确回答
BST only 您已回答
Both 正确回答
0.25 / 0.25 分
问题 4
The solution to the subset-sum problem for the master list: {17, 5, 3, 3, 7}
2021/2/21 Practice Exam with Proctorio 1 (Remotely Proctored): W21 CS F001C ADV DATA STRUCT/ALGORMS JAVA 01W Mazloom 30400
https://foothillcollege.instructure.com/courses/15985/quizzes/166256 6/11
with a the target 25 is:
23
24
22
15
26
25 正确!
Sublist {17, 5, 3} has the sum = 17 + 5 + 3 = 25 which is our target.
0 / 0.25 分
问题 5未回答
Lazy Deletion is good for ...
(Check all that apply.)
... fast insertion.
... conserving memory.
... fast removal. 正确回答

... suppressing frequent garbage collection for small numbers of removals.
正确回答
2021/2/21 Practice Exam with Proctorio 1 (Remotely Proctored): W21 CS F001C ADV DATA STRUCT/ALGORMS JAVA 01W Mazloom 30400
https://foothillcollege.instructure.com/courses/15985/quizzes/166256 7/11
Lazy deletion allow for a fast and easy removal, but makes
insertion slightly more complicated than it otherwise would be. It
does not make the memory of the tree any more efficient. In fact it
requires more memory since we are not releasing dead nodes
unless and until we do a garbage collection. It does reduce the
garbage collection, by its very definition.
0 / 0.25 分
问题 6
答案 1:
答案 2:
未回答
Match the item on the left with the best description on the right.

Choices - use a choice only once
A. are invoked without a type parameter in angled brackets, < >.
B. typically expect the client to supply a type parameter in angled brackets, < >.

Match each of the following to a choice
1. Generic classes. [选择]
2. Generic methods. [选择]

您将此项留空
您已回答
typically expect the client to supply a type parameter in angled brackets, <
>
正确回答
2021/2/21 Practice Exam with Proctorio 1 (Remotely Proctored): W21 CS F001C ADV DATA STRUCT/ALGORMS JAVA 01W Mazloom 30400
https://foothillcollege.instructure.com/courses/15985/quizzes/166256 8/11
您将此项留空
您已回答
are invoked without a parameter in angled brackets, < > 正确回答
0 / 0.25 分
问题 7未回答
What is the Big-Oh time complexity for this main algorithm (remember all variables
and structure of program assumed correct):
// in main()
for (k = 0; k < N; k++)
{
for (j = 0; j < M; j++)
myMethod(M);
}

// at global scope
void myMethod(int M)
{
int k, x;
for (k = 0; k < M; k++)
x = 1; // represents any constant-time statement.
}
(We allow the style transgression for the variable names N and M so that we can
easily isolate the relevant data sizes in this question.)
N * M正确回答 2
M3
N * M2
N3
2021/2/21 Practice Exam with Proctorio 1 (Remotely Proctored): W21 CS F001C ADV DATA STRUCT/ALGORMS JAVA 01W Mazloom 30400
https://foothillcollege.instructure.com/courses/15985/quizzes/166256 9/11
There are three loops in the code, all nested, two have length M
and one has length N.
0 / 0.25 分
问题 8未回答
Is this an AVL tree? Choose the one that best describes why.

No, because at node "10" the left subtree "4" and right subtree "16" differ
by more than 1.

No, because at node "30" the left subtree "null" and right subtree "34" differ
by more than 1.
正确回答

Yes, because at node "20" the left subtree "10" and right subtree "30" have
the same height.

No, because at node "20" the left subtree "10" and right subtree "30" differ
by more than 1.
2021/2/21 Practice Exam with Proctorio 1 (Remotely Proctored): W21 CS F001C ADV DATA STRUCT/ALGORMS JAVA 01W Mazloom 30400
https://foothillcollege.instructure.com/courses/15985/quizzes/166256 10/11

Yes, because the left and right subtrees of every node have heights
differing by at most 1.
Recall the AVL balance condition:
The height of each node's left and right subtree differ by at
most 1 (one).
This is not an AVL tree, because at node "30" the left subtree "null"
has a height of -1 and right subtree "34" has a height of 1.
0 / 0.25 分
问题 9未回答
What rotation is required to fix the following tree so that it meets the AVL height
condition?
2021/2/21 Practice Exam with Proctorio 1 (Remotely Proctored): W21 CS F001C ADV DATA STRUCT/ALGORMS JAVA 01W Mazloom 30400
https://foothillcollege.instructure.com/courses/15985/quizzes/166256 11/11
Single rotation centered at D
Single rotation centered at E
Single rotation centered at F
Single rotation centered at B.
Single rotation centered at C正确回答
None of the above.
This tree does not meet the AVL balance condition as the height of
the tree, because at root 3 (k ) the height of the left subtree is "F"
(k ) is 1 and the height of the right subtree "null" is -1.
A single rotation centered at C (k ) is required:

1
2
1
测验分数: 0.63,满分 2.25 分

欢迎咨询51作业君
51作业君

Email:51zuoyejun

@gmail.com

添加客服微信: abby12468