Question: Text Editor Buffer Develop and test a Buffer ADT with linked lists, not with Python lists, using the Stack ADT, with the following description: class

Text Editor Buffer

Develop and test a Buffer ADT with linked lists, not with Python lists, using the Stack ADT, with the following description:

class Buffer:

def insert(self, c) # insert c at the cursor

def 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.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!