Answer:
Explanation:
I have written the following code as a method in Java. You simply add the String Array as a parameter and it will create a linked list, placing the students in an even index first and then the odd indexed students second. Once the linked list is populated it prints it out to the system.
public static void StudentList(String[] students) {
LinkedList<String> names = new LinkedList<String>();
for (int x = 0; x < students.length; x++) {
if ((x % 2) == 0) {
names.add(students[x]);
}
}
for (int x = 0; x < students.length; x++) {
if ((x % 2) != 0) {
names.add(students[x]);
}
}
for (int x = 0; x < students.length; x++) {
System.out.println(names.get(x));
}
}