Linked Lists, Queue, Stacks
You are required to recreate the Generic classes for:
π Singly Linked list
π Stack
π Queue
π The Stack class should have the following methods
β IsEmpty() - returns true if the stack is empty and false is it isnβt
β Push(T item) β adds an item to the top of the stack
β Pop() β removes and returns the last item added to the stack
β Peek() - returns the last item added to the stack
β Size() - shows the number of items currently in the stack
π The Queue class should have the following methods:
β IsEmpty() - returns true if the queue is empty and false is it isnβt
β Enqueue(T item) β adds an item to the tail of the queue
β Dequeue() - removes and returns the item at the head of the queue
β Size() - shows the number of items currently in the queue
π The LinkedList class should have the following methods:
β Add(T item) - adds an item to the tail of the LinkedList and returns the linked listβs size
β Remove(T item) - removes the first occurrence of an item in the linked list, returns true if said item is found and removed or returns false otherwise
β Check(T item) - checks for a specified item in the linked list. Returns a Boolean
β Index(T item) - returns the index of an item or returns -1 if the item isnβt found