Q1Multiple correct5 Marks6 May 2026
Consider the following pseudocode for inserting elements into a sorted list. The pseudocode may have mistakes. Identify all such mistakes (if any).
```
Procedure SortedListInsert(L, x)
newList = []
inserted = False
foreach z in L{
if(inserted){
if(x < z){
newList = newList ++ [x]
inserted = true
}
}
newList = [z] ++ newList
}
if(not(inserted)){
newList = newList ++ [x]
}
return(newList)
End SortedListInsert
```
────────────────────────────────────────