Question: Using Scheme: Write a function that organizes an input list as a list of lists or a list of pairs where repeated elements are only
Using Scheme:


Write a function that organizes an input list as a list of lists or a list of pairs where repeated elements are only added once and instead a count is maintained, i.e., each element of the original list is the first element in a sub-list (or in a pair) with the count as the second element in the sub-list (or in the pair a) Create the predicate duplicatePair which evaluates to a list-of-pairs. Examples (duplicatePair '(1 a 5 62ba55)) ((1 . 1) (a . 2) (5 . 3) (6 . 1) (2.1) (b.1)) (duplicatePair '(b a a a))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
