Genericity Text Lab¶
The purpose of this exercise is to genericize some existing algorithms.
Question 1¶
The Swaps package contains a Swap procedure that takes
Integer parameters.
Try to genericize it as much as you can by creating a Swap_Generics package
with a generic Swap procedure
Question 2¶
The Sorts package provides types and procedures used to sort lists of Integers.
Create a generic Sort_Generics package that provide sorting capabilities for lists
containing any scalar type.
Question 3¶
Modifythe Sort_Generics package to allow sorting capabilities for lists containing
any type (including non-scalar types).
Find a way to resolve the problem that comes with the use of 'Image in
Sort_Generics.Display_List.