EBK DATA STRUCTURES AND ALGORITHMS IN C
EBK DATA STRUCTURES AND ALGORITHMS IN C
4th Edition
ISBN: 9781285415017
Author: DROZDEK
Publisher: YUZU
Question
Book Icon
Chapter 3, Problem 5PA
Program Plan Intro

Simple Line Editor

Program Plan:

  • A linked list which containing the nodes of type string is used to store the lines of the line editor.
  • Each line of the editor is saved in the each nodes of the linked list sequentially.
  • The line editor will start with a command “EDIT”, the word followed by the “EDIT” command will treated as the file name.
  • The command “I” is used to insert in the editor.
    • If the command “I” is followed by a number, the next line will save at that specific line.
    • If the insert comment “I” does not follow by any numbers, the next line will insert in the current position.
  • The command “D” is used to delete the lines from the editor.
    • If “D” is not followed by any numbers, then current line will be deleted.
    • If “D” is followed by one number, the line at that specific number will be deleted.
    • If “D” is followed by two numbers, then all the lines between those lines will be deleted.
  • The command “L” is used to list the lines as the delete does.
  • The command “A” will append the next line inserted to all the existing lines.
  • The command “E” is used to save the lines to a text file and exit the editor.

Blurred answer
Students have asked these similar questions
Read a series of characters from standard input and keep them in a linked list so that there are no duplicates. Put a newly introduced character at the top of the list when you read it in. If you read a character more than once, remove it from the list and put it back in at the beginning. The well-known move-to-front method, which is beneficial for caching, data compression, and many other applications where objects that have been recently accessed are more likely to be reaccessed, is implemented by the programme MoveToFront.
A singly linked circular list is a linked list where the last node in the list points to the first node in the list. A circular list does not contain NULL pointers. A good example of an application where a circular linked list should be used is an item in the shopping cart In an online shopping cart, the system must maintain a list of items and must calculate the total bill by adding the amount of all the items in the cart, Implement the above scenario using a Circular Link List of data structure in C++ Programming. Do Following: First create a class Item having id, name, price, and quantity provide appropriate methods and then Create Cart/List class which holds an items object to represent total items in the cart and next pointer Implement the method to add items in the array, remove an item and display all items. Now in the main do the following Insert Items in the list Display all items. Traverse the link list so that each item's bill gets calculated (by multiplying quantity with…
Write a program that reads information about employees of a company from a file.  The information in the file is ordered based on the salary.  An employee with the highest salary, for example, should appear at the top.  Your program should first read the contents of the input file, create a linked list to store the contents, and then display the original list. Then, it will delete the employee with ID 444444444 from the list and will display the list again.  The last step your program perform is to insert three new employees into the list and display the final results.  Here is the information on the three new employees Given: Last Name               First Name               ID             Phone          Salary=========== ========== ========   =======      =====Wood                       Carpenter        333556666  222-222-2222    40000Ironman                    Iron                 444444443  828-888-8888    73000Goal-keeper             Martin              777777777  888-666-8888…
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education