Q4.Let `SortedL` be a list of integers sorted in ascending order. The procedure `deleteVal(SortedL, X)` is supposed to delete the first instance of `X` from `SortedL`, if it exists, while maintaining the sorted order. Identify the correct implementation(s). Assume `member` checks existence and `remove` removes the first occurrence in-place.
Save
Check
Details
Q4
6 Apr 2026
Q4.Let `SortedL` be a list of integers sorted in ascending order. The procedure `deleteVal(SortedL, X)` is supposed to delete the first instance of `X` from `SortedL`, if it exists, while maintaining the sorted order. Identify the correct implementation(s). Assume `member` checks existence and `remove` removes the first occurrence in-place.