Skip to content

saurabh0vipin/Text_Editor-Two_Stack_Model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

Text_Editor:Two_Stack_Model

Implemented Using C++ Object Oriented Programming.

We used the cursor position as ‘divider’ and maintained two stacks to hold characters on either side. All characters to the left of cursor are pushed on the ‘left’ stack All characters to its right, are pushed on the ‘right’ stack.

Use 2 stacks to depict the text editor

Task Operation
Insert a character/word push it on the left Stack
Delete a character using DEL perform pop operation on the right stack
Delete a character using Backspace perform pop operation on the left stack
Move cursor to the left copy the required characters from left stack to right stack
Move cursor to the right copy the required characters from right stack to left stack
To replace Use a combination of move cursor with DEL and insert operations

About

Text Editor functionality using C++ OOPs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages