Question: Develop and test a Buffer ADT with linked lists, not with Python lists, using the Stack ADT, with the following description: class Buffer: insert(self, c)
Develop and test a Buffer ADT with linked lists, not with Python lists, using the Stack ADT, with the following description:
class Buffer:
insert(self, c) # insert c at the cursor
get(self) # return the character at the cursor
delete(self) # delete and return the character at the cursor
left (self, k) # move the cursor left k positions
right (self, k) # move the cursor right k positions
size(self) # return the number of characters in the buffer
Hint: use two stacks.
I have to use LINKED list and not PYTHON list. Also i have to incude 2 stacks in the code
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
