Question 1 of 5
playlist=["up","mid","down"] (a) After INSERT(playlist,3,"bridge")? (b) Then REMOVE(playlist,1)? (c) playlist[2] at end?
Responses receive AI feedback against a rubric after submission. Scores are practice estimates.
playlist=["up","mid","down"] (a) After INSERT(playlist,3,"bridge")? (b) Then REMOVE(playlist,1)? (c) playlist[2] at end?
data=[4,5,6,7] (a) Shift caused by REMOVE(data,3)? (b) Resulting list? (c) LENGTH after?
tags=["new","sale","gift","warm"]. APPEND(tags,"cool") then REMOVE(tags,2). (a) After APPEND? (b) After REMOVE? (c) How index of gift changes?
Trace box starting [0,0,0]:
| Operation | box after | LENGTH |
|---|---|---|
| INSERT(box, 1, 9) | ||
| box[4] ← 1 |
(a) Fill both rows. (b) Why can assignment use index 4 after INSERT? (c) LENGTH if INSERT had not run before assigning index 4?
queue=["r","s","t","u"] REMOVE(queue,4) INSERT(queue,2,"q") (a) Final list? (b) Final LENGTH? (c) Compare final index of s to original.