public void Clear() { if (size > 0) { for (int i = size - 1; i >= 0; i--) { hashTable.Remove(i); } size = 0; } }
//Removing the first element of the queue public T Remove() { T element = queue.Get(0); if (size > 0) { queue.Remove(0); size -= 1; } return(element); }
public Item <T> Remove() { Item <T> item = priorityQueue.Get(0); if (size > 0) { priorityQueue.Remove(0); size -= 1; } return(item); }
//Removing the top element of the stack public T Pop() { T element = stack.Get(size - 1); if (size > 0) { stack.Remove(size - 1); size -= 1; } else { size = 0; } return(element); }