You are writing a procedure to add a node to a doubly linked list. The system on which this procedure is to be run is subject to periodic hardware failures. The list your program is to maintain is of great importance. Your program must ensure the integrity of the list, even if the machine fails in the middle of executing your procedure. Supply the individual statements to update the list. (Your
list should be fewer than a dozen statements long.) Explain the effect of a machine failure after each instruction. Describe how you would revise this procedure so that it would restore the integrity of the basic list after a machine failure.
What will be an ideal response?
The
key
condition
is
that
the
new
node
should
be
attached
before
any
nodes
in
the
original
list
are
changed.
Suppose
A
and
B
are
original
nodes,
and
N
is
to
be
inserted
between
them.
Existing
links
are
A
?
B
and
A
?
B.
The
links
in
N
should
be
set
first,
so
that
A
?
N
and
N
?
B.
Then,
either
A
or
B
is
changed
so
that
A
?
N.
At
this
point,
in
the
event
of
a
failure,
the
backward
link
from
B
to
A
will
be
incorrect.
In
the
event
of
a
failure,
a
recovery
procedure
is
run
to
test
consistency
of
forward
and
backward
links.
In
case
of
inconsistency,
the
forward
link
is
taken
to
be
correct,
and
the
backward
link
is
set
to
match.
This
back
link
completes
the
correct
chain.
If
no
failure
occurs,
the
adding
process
completes
by
setting
N
?
B.
You might also like to view...
Which of the following is one of the tools on the court-approved lists issued by the Federal Judiciary?
a. Encase b. Sleuthkit c. FTK d. Paraben e. There is no list of court-approved tools.
Malicious tampering occurring internally by a disgruntled employee can subtly alter data that may not be noticed for some time after the employee leaves the company
Indicate whether the statement is true or false
Find an equation of a line given the following information. The final answer should be left in slope-intercept form. Passes through the point slope
A.
B.
C.
D.
E.
A leap year occurs when the year number (e.g. 1984 ) is divisible by 4. But there is a special case for years ending in 00: these must be divisible by 400 to be considered a leap year. Thus, 1900 was not a leap year, but 2000 was. Write an if-statement that determines if the integer variable year represents a leap year. (Hint: use the % operator for taking remainders.)
What will be an ideal response?