5
Start: stack=[], top=-1
push(7): stack=[7], top=0
push(3): stack=[7,3], top=1
push(9): stack=[7,3,9], top=2
pop(): returns 9, stack=[7,3], top=1
push(5): stack=[7,3,5], top=2
peek(): returns 5, stack unchanged=[7,3,5], top=2
(1 mark per correct state; award all 5 for fully correct trace)