Courses‎ > ‎APCS - Term 1‎ > ‎Konstantinovich‎ > ‎

2019-03-29

posted Mar 29, 2019, 5:38 AM by Konstantinovich Samuel   [ updated Mar 29, 2019, 6:21 AM ]
Monday We will start Radix
Repo:
MKS22X-Radix


Make a custom linked list class by Monday:

MyLinkedList.java 
Requies the following functionality: (I don't care what you name the methods, this is not a class that is being tested directly)

public String toString() 
    not REQUIRED, but it would be crazy of you not to have this
public MyLinkedList()
    construct an empty list
public void clear()
    reset the list to an empty state. Very similar to the constructor.
public boolean/void add(E)
    add an element to the end of the list (the boolean would be true all the time if you want to conform to list standards)
public void extend(MyLinkedList<E> other)
     in O(1) time, connect the other list to the end of this list.
    The other list is then reset to size 0 (do not wipe out the nodes, just disconnect them.)
    This is how you will merge lists together for your radix sort.
public E removeFront()
    remove the 1st element of the list, and return that value.
OPTIONALLY:
    A working iterator would be faster than remove front for traversing the list.

Comments