This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package lect; | |
public class MemoryUsage { | |
private static final long MEGABYTE = 1024L * 1024L; | |
private static final long KILOBYTE = 1024L; | |
public static long bytesToKilobytes(long bytes) { | |
return bytes / KILOBYTE; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package lect; | |
public class MyArrayList<E> extends MyAbstractList<E> { | |
public static final int INITIAL_CAPACITY = 16; | |
private E[] data = (E[])new Object[INITIAL_CAPACITY]; | |
/** Create a default list */ | |
public MyArrayList() { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package lect; | |
import java.util.Comparator; | |
import java.util.Iterator; | |
public class MyLinkedList<E> extends MyAbstractList<E> { | |
public Node<E> head; | |
private Node<E> tail; | |
Node<E> sorted; |