2023 In this assignment you will compare two implementations of storing text files 1 One continuous string newline char as separator | Assignment Collections

Computer Science 2023 Py

2023 In this assignment you will compare two implementations of storing text files 1 One continuous string newline char as separator | Assignment Collections

  

In this assignment you will compare two implementations of storing text files:

(1) One continuous string (newline char as separator).

(2) List of strings where each string represents a line

Each of these representations has to be implemented as a separate set of functions and, of course, with separate Python file For each implementation, you will write editor functions to move the “cursor”. In each representation, you use a cursor to represent the current position. For example, for (1) the cursor is just the position (index). For (2), the cursor is a pair: the index of the line and the position within the corresponding line string. Finally, for (3) the cursor is a pointer to the node (containing the line) and the position within that line.

Write (and test) the following 10 functions (names are taken from old vi editor) for each implementation

(1) cmd_h: move cursor one character to the left 

a. string implementation for text editor

b. list implementation for text editor

c. double linked list implementation for text editor

(2) cmd_I: move cursor one character to the right

a. string implementation for text editor

b. list implementation for text editor

c. double linked list implementation for text editor

(3) cmd_j: move cursor vertically up one line 

a. string implementation for text editor

b. list implementation for text editor

c. double linked list implementation for text editor

(4) cmd_k: move cursor vertically down one line

a. string implementation for text editor

b. list implementation for text editor

c. double linked list implementation for text editor

(5) cmd_X: delete the character to the left of the cursor

a. string implementation for text editor

b. list implementation for text editor

c. double linked list implementation for text editor

(6) cmd_D: remove on current line from cursor to the end

a. string implementation for text editor

b. list implementation for text editor

c. double linked list implementation for text editor

(7) cmd_dd: delete current line and move cursor to the 

a. string implementation for text editor

b. list implementation for text editor

c. double linked list implementation for text editor

beginning of next line

(8) cmd_ddp: transpose two adjacent lines

a. string implementation for text editor

b. list implementation for text editor

c. double linked list implementation for text editor

(9) cmd_n: search for next occurrence of a string (assume that string to be searched is fully in one line.

a. string implementation for text editor

b. list implementation for text editor

c. double linked list implementation for text editor

(10) cmd_wq: write your representation as text file and save it

a. string implementation for text editor

b. list implementation for text editor

c. double linked list implementation for text editor

Think of and implement any other 5 functions (your choice)

(11)~(15)

a. string implementation for text editor

b. list implementation for text editor

c. double linked list implementation for text editor

For testing, you will read the following “nerdy” poem (from the “Zen of Python”) into your “file representation”. 

Beautiful is better than ugly.

Explicit is better than implicit.

Simple is better than complex.

Complex is better than complicated.

After each command, print the contents of your file with character ‘^’ as cursor. 

Example: your initial configuration is 

^Beautiful is better than ugly.

Explicit is better than implicit.

Simple is better than complex.

Complex is better than complicated.

After executing cmd_n(‘better”), your representation should print:

Beautiful is ^better than ugly.

Explicit is better than implicit.

Simple is better than complex.

Complex is better than complicated.

 

We give our students 100% satisfaction with their assignments, which is one of the most important reasons students prefer us to other helpers. Our professional group and planners have more than ten years of rich experience. The only reason is that we have successfully helped more than 100000 students with their assignments on our inception days. Our expert group has more than 2200 professionals in different topics, and that is not all; we get more than 300 jobs every day more than 90% of the assignment get the conversion for payment.

Place Order Now

#write essay #research paper #blog writing #article writing #academic writer #reflective paper #essay pro #types of essays #write my essay #reflective essay #paper writer #essay writing service #essay writer free #essay helper #write my paper #assignment writer #write my essay for me #write an essay for me #uk essay #thesis writer #dissertation writing services #writing a research paper #academic essay #dissertation help #easy essay #do my essay #paper writing service #buy essay #essay writing help #essay service #dissertation writing #online essay writer #write my paper for me #types of essay writing #essay writing website #write my essay for free #reflective report #type my essay #thesis writing services #write paper for me #research paper writing service #essay paper #professional essay writers #write my essay online #essay help online #write my research paper #dissertation writing help #websites that write papers for you for free #write my essay for me cheap #pay someone to write my paper #pay someone to write my research paper #Essaywriting #Academicwriting #Assignmenthelp #Nursingassignment #Nursinghomework #Psychologyassignment #Physicsassignment #Philosophyassignment #Religionassignment #History #Writing #writingtips #Students #universityassignment #onlinewriting #savvyessaywriters #onlineprowriters #assignmentcollection #excelsiorwriters #writinghub #study #exclusivewritings #myassignmentgeek #expertwriters #art #transcription #grammer #college #highschool #StudentsHelpingStudents #studentshirt #StudentShoe #StudentShoes #studentshoponline #studentshopping #studentshouse #StudentShoutout #studentshowcase2017 #StudentsHub #studentsieuczy #StudentsIn #studentsinberlin #studentsinbusiness #StudentsInDubai #studentsininternational