In dictionary arrangement, words are compared letter by letter from the left.
For set (i): “attractive” begins with ‘a’, so it comes first. Next is “bonfire” (b), followed by “optimistic” (o), and lastly “rumour” (r).
For set (ii): “patter” comes first since after “pa” it has “t” (smaller alphabetically than “e”, “o”). Then comes “people” (pe), then “pocket” (po), and finally “potter” (po + t), which alphabetically follows “pocket.”