Question: Develop a data type for a buffer in a text editor that implements the following API: public class Buffer Buffer () void insert(char c) char
Develop a data type for a buffer in a text editor that implements the following API:

public class Buffer Buffer () void insert(char c) char delete() void left(int k) void right(int k) int size() create an empty buffer insert c at the cursor position delete and return the character at the cursor move the cursor k positions to the left move the cursor k positions to the right number of characters in the buffer API for a text buffer
Step by Step Solution
3.37 Rating (163 Votes )
There are 3 Steps involved in it
The provided API outlines the operations that a text buffer data type must support akin to a basic text editor functionality To implement this buffer ... View full answer
Get step-by-step solutions from verified subject matter experts
