/** HW #1 solutions. * * @author */ class Progs { /* 1a. */ /** Returns the sum of all integers, k, such that 1 <= k < N and * N is evenly divisible by k. */ static int factorSum(int N) { /* *Replace the following with the answer* */ return 0; } /* 1b. */ /** Print the set of all sociable pairs whose members are all * between 1 and N>=0 (inclusive) on the standard output (one pair per * line, smallest member of each pair first, with no repetitions). */ static void printSociablePairs(int N) { /* *Fill in here* */ } /* 2a. */ /** Returns a list consisting of the elements of A followed by the * elements of B. May modify items of A. Don't use 'new'. */ static IntList dcatenate(IntList A, IntList B) { /* *Replace the following with the answer* */ return null; } /* 2b. */ /** Returns the sublist consisting of LEN items from list L, * beginning with item #START (where the first item is #0). * Does not modify the original list elements. * It is an error if the desired items don't exist. */ static IntList sublist(IntList L, int start, int len) { /* *Replace the following with the answer* */ return null; } /* 2c. */ /** Returns the sublist consisting of LEN items from list L, * beginning with item #START (where the first item is #0). * May modify the original list elements. Don't use 'new'. * It is an error if the desired items don't exist. */ static IntList dsublist(IntList L, int start, int len) { /* *Replace the following with the answer* */ return null; } }