Q14Multiple correct4 Marks1 Dec 2024
We have a non-empty list `Publisher` that stores the publisher name in each card from the Library dataset, sorted in alphabetical order. This results in many duplicates. The following procedure attempts to extract the unique list of publishers, while preserving the sorted order. The pseudocode may have mistakes. Identify all such mistakes, if any.
```
1 uniqueList = [first(Publisher)]
2 prev = last(Publisher)
3 for each x in rest(Publisher) {
4 if(x != prev) {
5 uniqueList = uniqueList ++ x
6 }
7 prev = x
8 }
```