Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Which of the following pseudocode algorithms correctly inserts a record called n

ID: 3557333 • Letter: W

Question

Which of the following pseudocode algorithms correctly inserts a record called
new_record immediately after the record called current_record in a linked
list?

(HINT: to help you solve the problem, draw a picture of a linked list with 3 items,
where current_record is the middle item. Draw new_record outside the list,
then follow the steps of each algorithm to see how the list is changed.)

Algorithm #1

1. set the pointer field of current_record to point to new_record
2. set the pointer field of new_record to point to the record pointed to by
current_record

Algorithm #2

1. set the pointer field of new_record to point to the record pointed to by
current_record
2. set the pointer field of current_record to point to new_record

correct algorithm is: ________________________

briefly, what is wrong with the other algorithm?

_________________________________________________________________
______________________________________________________________

Explanation / Answer

correct algorithm is: ___Algorithm #1_____________________

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote