Assuming an algorithmic linked list with the following behaviour:
addFirst(element data)
addLast(element data)
element removeFirst()
element removeLast()
boolean isEmpty()
- Write algorithms to implement a stack using the functions alone,
- push (element data)
- element pop ()
- element peek() (Hint: get the data out then put it back in)
- Write algorithms to implement a Queue using the functions alone,
- enqueue (element data) //add
- element dequeue () //remove
© 2023 Vedesh Kungebeharry. All rights reserved.