public static void main(String[] args) { // TODO Auto-generated method stub List a = new List(); a.insert(1); a.insert(0); a.insert(2); a.insert(1); a.printlist(); a.order(); }
@Override public void addEntry(K key, V value) { Mapping map = new Mapping(key, value); if (this.containsKey(key)) { table.find(map); table.remove(); table.insert(map); numberOfMappings++; } else { table.insert(map); numberOfMappings++; } }
@Override public Set<E> addElement(E id) { if (!this.contains(id)) { setList.insert(id); } return this; }
public void insert(int data) { if (data > this.x) { next.insert(data); } else { next = new List(x, next); x = data; } }
/** @param args */ public static void main(String[] args) { // TODO Auto-generated method stub List myList = new List(); myList.insert(2); myList.insert(10); myList.insert(12); myList.insert(4); myList.insert(17); myList.insert(21); myList.insert(222); myList.display(); System.out.println("------------------"); myList.reverse(); myList.display(); System.out.println("------------------"); reverse(myList); myList.display(); System.out.println("------------------"); recursivereverse1(myList); myList.display(); System.out.println("------------------"); myList.insert(252); myList.display(); }
private static void command(String input) { if (commander.equals("PRINT")) { movieList.printListAll(movieList); } else if (commander.equals("SEARCH")) { keyword = genre; // 리스트 중 keyword 를 포함하는 것이 있으면 다 출력한다. movieList.search(keyword); } else if (commander.equals("INSERT")) { movieList.insert(genre, title); } else if (commander.equals("DELETE")) { movieList.delete(genre, title); } }
public static void main(String[] args) { int len = 0; CATG.pathRegex("test", "(a?a?b)"); List list = new List(); while (CATG.readBool(false)) { len++; int x = CATG.readInt(0); System.out.print("Input "); System.out.println(x); list.insert(x); System.out.println("Length = " + len); CATG.event("test", "a"); } CATG.event("test", "b"); }