A Unified Approach to Algorithms Generating Unrestricted and Restricted Integer Compositions and Integer Partitions