public void AddtoStart(int d) { DoublyNode new_node = new DoublyNode(d); if (start == null) { start = new_node; end = start; } else { start.prev = new_node; new_node.next = start; start = new_node; } size++; }
public void AddtoEnd(int d) { DoublyNode new_node = new DoublyNode(d); if (start == null) { start = new_node; end = start; } else { new_node.prev = end; end.next = new_node; end = new_node; } size++; }