Reading material

If you use the first edition of the textbook, follow the reading material in orange. If you use the second edition, follow the reading material in brown.

(1st) Pages 697-699 (Section A.6), pages 67-69 (Section 3.1.1), pages 78-79 (Section 3.2.1), page 93 (Section 3.4.1), page 116 (Section 4.1.1), pages 122-125 (Section 4.2.1-4.2.3)

(2nd) Pages 80-84 (Section 2.4), pages 136-140 (Section 4.1.1), pages 149-152 (Section 4.2.1), page 166 (Section 4.4.1), page 186 (Section 5.1.1), pages 194-198 (Section 5.2.1-5.2.3)

Additional material

Interfaces
First edition Second edition
RankedSequence Vector
replaceElemAtRank replaceAtRank
insertElemAtRank insertAtRank
removeElemAtRank removeAtRank

Question

Complete the following methods.

/**
 * Multiplies all the integers stored in the specified
 * ranked sequence/vector by 2.
 *
 * @param vector Ranked sequence/vector whose elements
 * are integers.
 */
public static void double(Vector vector)
{

}

/**
 * Multiplies all the integers stored in the specified
 * positional sequence/list by 2.
 *
 * @param vector Positional sequence/list whose elements
 * are integers.
 */
public static void double(List list)
{

}