SlideShare a Scribd company logo
1 of 1
Download to read offline
D. Maintaining History
The final milestone of the project is to build the history component. The history can be
represented as a linked list data structure, with each node containing:
an id based on its place in the list,
the string entered by user,
and, a pointer to the next node.
Inside the history.h header file you will find two struct declarations representing this notion.
Overall, a user should be able to:
view the history of strings entered by the user
and recall a certain history item by using the command !3 (i.e. an exclamation directly followed
by the sequence number).
You should define each function from the history.h header file in a separate history.c file and
then incorporate the history with your tokenizer and interface.
File Edit Options Buffers Tools C Help #ifndef _HISTDRY Hdef ine _HISTORY typedef struct
s_Item { int id; char *str: struct s_Item *next; I Item; typedef struct s _ L List f struct s_Item
*root; Hist; / Initialize the linked list to keep the history.*/ List* init_history(); * Add a history
item to the end of the list. List* list - the linked 1 ist char* str - the string to store */ void
add_history(List *list, char *str); * Retrieve the string stored in the node where Item->id == id.
List* list - the 1 inked list int id - the id of the Item to f ind / char *get_history(List *list, int id); /
Print the entire contents of the list. */ vid print_history(List *list); / Free the history 1 ist and the
strings it references. */ wid free_history(List *list); #end if -UU-:----F1 history.h All ( 6 , 0 )
Git-master (C/l Abbreu)

More Related Content

Similar to D- Maintaining History The final milestone of the project is to build.pdf

Complete a C++ class implementation for a linked-list of sorted (asc.pdf
Complete a C++ class implementation for a linked-list of sorted (asc.pdfComplete a C++ class implementation for a linked-list of sorted (asc.pdf
Complete a C++ class implementation for a linked-list of sorted (asc.pdf
shahidqamar17
 
Q2 Write a C program called myupper4.c to take as command line inpu.pdf
Q2 Write a C program called myupper4.c to take as command line inpu.pdfQ2 Write a C program called myupper4.c to take as command line inpu.pdf
Q2 Write a C program called myupper4.c to take as command line inpu.pdf
boothlynntur11512
 
in c languageTo determine the maximum string length, we need to .pdf
in c languageTo determine the maximum string length, we need to .pdfin c languageTo determine the maximum string length, we need to .pdf
in c languageTo determine the maximum string length, we need to .pdf
stopgolook
 
written in c- please answer the 4 questions and write the functions ba.pdf
written in c- please answer the 4 questions and write the functions ba.pdfwritten in c- please answer the 4 questions and write the functions ba.pdf
written in c- please answer the 4 questions and write the functions ba.pdf
sravi07
 
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docxlab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
DIPESH30
 
-- Write the compiler used- Visual studio or gcc -- Reminder that your.pdf
-- Write the compiler used- Visual studio or gcc -- Reminder that your.pdf-- Write the compiler used- Visual studio or gcc -- Reminder that your.pdf
-- Write the compiler used- Visual studio or gcc -- Reminder that your.pdf
ganisyedtrd
 
please follow all instructions and answer the inbedded questions- and.pdf
please follow all instructions and answer the inbedded questions- and.pdfplease follow all instructions and answer the inbedded questions- and.pdf
please follow all instructions and answer the inbedded questions- and.pdf
Ian5L3Allanm
 
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdfAssignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
formicreation
 

Similar to D- Maintaining History The final milestone of the project is to build.pdf (20)

Structure and Typedef
Structure and TypedefStructure and Typedef
Structure and Typedef
 
Str
StrStr
Str
 
The TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux KernelThe TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux Kernel
 
Complete a C++ class implementation for a linked-list of sorted (asc.pdf
Complete a C++ class implementation for a linked-list of sorted (asc.pdfComplete a C++ class implementation for a linked-list of sorted (asc.pdf
Complete a C++ class implementation for a linked-list of sorted (asc.pdf
 
Q2 Write a C program called myupper4.c to take as command line inpu.pdf
Q2 Write a C program called myupper4.c to take as command line inpu.pdfQ2 Write a C program called myupper4.c to take as command line inpu.pdf
Q2 Write a C program called myupper4.c to take as command line inpu.pdf
 
in c languageTo determine the maximum string length, we need to .pdf
in c languageTo determine the maximum string length, we need to .pdfin c languageTo determine the maximum string length, we need to .pdf
in c languageTo determine the maximum string length, we need to .pdf
 
written in c- please answer the 4 questions and write the functions ba.pdf
written in c- please answer the 4 questions and write the functions ba.pdfwritten in c- please answer the 4 questions and write the functions ba.pdf
written in c- please answer the 4 questions and write the functions ba.pdf
 
U5 SPC.pptx
U5 SPC.pptxU5 SPC.pptx
U5 SPC.pptx
 
U5 SPC.pptx
U5 SPC.pptxU5 SPC.pptx
U5 SPC.pptx
 
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docxlab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
 
Unit7 C
Unit7 CUnit7 C
Unit7 C
 
Chapter 5 ds
Chapter 5 dsChapter 5 ds
Chapter 5 ds
 
Programming in C
Programming in CProgramming in C
Programming in C
 
Programming in C
Programming in CProgramming in C
Programming in C
 
C Structures & Unions
C Structures & UnionsC Structures & Unions
C Structures & Unions
 
-- Write the compiler used- Visual studio or gcc -- Reminder that your.pdf
-- Write the compiler used- Visual studio or gcc -- Reminder that your.pdf-- Write the compiler used- Visual studio or gcc -- Reminder that your.pdf
-- Write the compiler used- Visual studio or gcc -- Reminder that your.pdf
 
C++ Please write the whole code that is needed for this assignment- wr.docx
C++ Please write the whole code that is needed for this assignment- wr.docxC++ Please write the whole code that is needed for this assignment- wr.docx
C++ Please write the whole code that is needed for this assignment- wr.docx
 
File handling in c++
File handling in c++File handling in c++
File handling in c++
 
please follow all instructions and answer the inbedded questions- and.pdf
please follow all instructions and answer the inbedded questions- and.pdfplease follow all instructions and answer the inbedded questions- and.pdf
please follow all instructions and answer the inbedded questions- and.pdf
 
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdfAssignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
 

More from deepak596396

Derive the Hicksian demand functions for goods 1 and 2 using Envelope.pdf
Derive the Hicksian demand functions for goods 1 and 2 using Envelope.pdfDerive the Hicksian demand functions for goods 1 and 2 using Envelope.pdf
Derive the Hicksian demand functions for goods 1 and 2 using Envelope.pdf
deepak596396
 
Demonstrate your knowiedfe- Refer to the text and figures as netiod- t.pdf
Demonstrate your knowiedfe- Refer to the text and figures as netiod- t.pdfDemonstrate your knowiedfe- Refer to the text and figures as netiod- t.pdf
Demonstrate your knowiedfe- Refer to the text and figures as netiod- t.pdf
deepak596396
 
Exercise- You will use the TCP echo client and server code (for IPv4 v.pdf
Exercise- You will use the TCP echo client and server code (for IPv4 v.pdfExercise- You will use the TCP echo client and server code (for IPv4 v.pdf
Exercise- You will use the TCP echo client and server code (for IPv4 v.pdf
deepak596396
 

More from deepak596396 (20)

Describe how the bioavailability of calcium varies and then identify s.pdf
Describe how the bioavailability of calcium varies and then identify s.pdfDescribe how the bioavailability of calcium varies and then identify s.pdf
Describe how the bioavailability of calcium varies and then identify s.pdf
 
Describe communication choices at each stage of the speech creation pr.pdf
Describe communication choices at each stage of the speech creation pr.pdfDescribe communication choices at each stage of the speech creation pr.pdf
Describe communication choices at each stage of the speech creation pr.pdf
 
Describe an algorithm for concatenating two singly linked lists L and.pdf
Describe an algorithm for concatenating two singly linked lists L and.pdfDescribe an algorithm for concatenating two singly linked lists L and.pdf
Describe an algorithm for concatenating two singly linked lists L and.pdf
 
Deion- a very-task oriented leader- has recently taken on a management.pdf
Deion- a very-task oriented leader- has recently taken on a management.pdfDeion- a very-task oriented leader- has recently taken on a management.pdf
Deion- a very-task oriented leader- has recently taken on a management.pdf
 
Derive the Hicksian demand functions for goods 1 and 2 using Envelope.pdf
Derive the Hicksian demand functions for goods 1 and 2 using Envelope.pdfDerive the Hicksian demand functions for goods 1 and 2 using Envelope.pdf
Derive the Hicksian demand functions for goods 1 and 2 using Envelope.pdf
 
deram pacios) Ths 05- coridecocai inteivel bored vooa n-100 is decima.pdf
deram pacios) Ths 05- coridecocai inteivel bored vooa n-100 is decima.pdfderam pacios) Ths 05- coridecocai inteivel bored vooa n-100 is decima.pdf
deram pacios) Ths 05- coridecocai inteivel bored vooa n-100 is decima.pdf
 
Demonstrate your knowiedfe- Refer to the text and figures as netiod- t.pdf
Demonstrate your knowiedfe- Refer to the text and figures as netiod- t.pdfDemonstrate your knowiedfe- Refer to the text and figures as netiod- t.pdf
Demonstrate your knowiedfe- Refer to the text and figures as netiod- t.pdf
 
D- Classifying Acids and Bases The pH of a solution is a number which.pdf
D- Classifying Acids and Bases The pH of a solution is a number which.pdfD- Classifying Acids and Bases The pH of a solution is a number which.pdf
D- Classifying Acids and Bases The pH of a solution is a number which.pdf
 
Deliverable- Create two single user empathy maps- as described below-.pdf
Deliverable- Create two single user empathy maps- as described below-.pdfDeliverable- Create two single user empathy maps- as described below-.pdf
Deliverable- Create two single user empathy maps- as described below-.pdf
 
d- By how much does the supply of money supply or contract- Supply of.pdf
d- By how much does the supply of money supply or contract- Supply of.pdfd- By how much does the supply of money supply or contract- Supply of.pdf
d- By how much does the supply of money supply or contract- Supply of.pdf
 
Define the following terms- and explain it in your own words with exam.pdf
Define the following terms- and explain it in your own words with exam.pdfDefine the following terms- and explain it in your own words with exam.pdf
Define the following terms- and explain it in your own words with exam.pdf
 
Deinococcus radiodurans is a bacteria with a very peculiar special abi.pdf
Deinococcus radiodurans is a bacteria with a very peculiar special abi.pdfDeinococcus radiodurans is a bacteria with a very peculiar special abi.pdf
Deinococcus radiodurans is a bacteria with a very peculiar special abi.pdf
 
Define a method printFeetinchShort- with int parameters numFeet and nu.pdf
Define a method printFeetinchShort- with int parameters numFeet and nu.pdfDefine a method printFeetinchShort- with int parameters numFeet and nu.pdf
Define a method printFeetinchShort- with int parameters numFeet and nu.pdf
 
Define a method named orderOfAppearance() that takes the name of a rol.pdf
Define a method named orderOfAppearance() that takes the name of a rol.pdfDefine a method named orderOfAppearance() that takes the name of a rol.pdf
Define a method named orderOfAppearance() that takes the name of a rol.pdf
 
D) there is little change across horizontal distances- Question 14 (Ma.pdf
D) there is little change across horizontal distances- Question 14 (Ma.pdfD) there is little change across horizontal distances- Question 14 (Ma.pdf
D) there is little change across horizontal distances- Question 14 (Ma.pdf
 
Define a method findResources() that takes two integer parameters as a.pdf
Define a method findResources() that takes two integer parameters as a.pdfDefine a method findResources() that takes two integer parameters as a.pdf
Define a method findResources() that takes two integer parameters as a.pdf
 
Exhibit 11-7 We want to test the hypothesis that population B has a.pdf
Exhibit 11-7    We want to test the hypothesis that population B has a.pdfExhibit 11-7    We want to test the hypothesis that population B has a.pdf
Exhibit 11-7 We want to test the hypothesis that population B has a.pdf
 
Exercise- You will use the TCP echo client and server code (for IPv4 v.pdf
Exercise- You will use the TCP echo client and server code (for IPv4 v.pdfExercise- You will use the TCP echo client and server code (for IPv4 v.pdf
Exercise- You will use the TCP echo client and server code (for IPv4 v.pdf
 
Exercise 8 1- Discuss the relevance of the Dutch disease problem for.pdf
Exercise 8  1- Discuss the relevance of the Dutch disease problem for.pdfExercise 8  1- Discuss the relevance of the Dutch disease problem for.pdf
Exercise 8 1- Discuss the relevance of the Dutch disease problem for.pdf
 
EXERCISE 7 - Let (Xn)n1 be a sequence of random variables such that Xn.pdf
EXERCISE 7 - Let (Xn)n1 be a sequence of random variables such that Xn.pdfEXERCISE 7 - Let (Xn)n1 be a sequence of random variables such that Xn.pdf
EXERCISE 7 - Let (Xn)n1 be a sequence of random variables such that Xn.pdf
 

Recently uploaded

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
ssuserdda66b
 

Recently uploaded (20)

This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 

D- Maintaining History The final milestone of the project is to build.pdf

  • 1. D. Maintaining History The final milestone of the project is to build the history component. The history can be represented as a linked list data structure, with each node containing: an id based on its place in the list, the string entered by user, and, a pointer to the next node. Inside the history.h header file you will find two struct declarations representing this notion. Overall, a user should be able to: view the history of strings entered by the user and recall a certain history item by using the command !3 (i.e. an exclamation directly followed by the sequence number). You should define each function from the history.h header file in a separate history.c file and then incorporate the history with your tokenizer and interface. File Edit Options Buffers Tools C Help #ifndef _HISTDRY Hdef ine _HISTORY typedef struct s_Item { int id; char *str: struct s_Item *next; I Item; typedef struct s _ L List f struct s_Item *root; Hist; / Initialize the linked list to keep the history.*/ List* init_history(); * Add a history item to the end of the list. List* list - the linked 1 ist char* str - the string to store */ void add_history(List *list, char *str); * Retrieve the string stored in the node where Item->id == id. List* list - the 1 inked list int id - the id of the Item to f ind / char *get_history(List *list, int id); / Print the entire contents of the list. */ vid print_history(List *list); / Free the history 1 ist and the strings it references. */ wid free_history(List *list); #end if -UU-:----F1 history.h All ( 6 , 0 ) Git-master (C/l Abbreu)