Starting from:

$30

Seng1120-Assignment 1 Double Linked List Solved

INTRODUCTION 

You are required to build the infrastructure to manipulate data related to text. Your client further specifies that you are to create a class named LinkedList to store individual tokens. The LinkedList will store each token in a Node of the list, using the class string. 

 

 

ASSIGNMENT TASK 

You are required to use a doubly-linked list, as discussed in lectures, to create your own implementation of the LinkedList class. It will use instances of Node to store instances of value_type (in this assignment, each Node will be used to store an instance of string). Your list will be used to store the individual words of a sentence, broken up on the spaces; so each Node will store a single word. For instance, “The Black Cat” will add three separate words (“The”, “Black”, “Cat”) to the list. 

 

The LinkedList class will be used by a main program, to be supplied to you, as well as a makefile. You will need to design LinkedList and Node in a way that it communicates seamlessly with the main program and compiles with the makefile also supplied. Please refer to the lecture slides and recordings for guidance on how to implement both classes. 

 

For students in SENG6120, there is an extra requirement:  

• (3.0 marks) Extend the member method void remove(string) inside LinkedList. The extended method  pattern matches and then removes all occurrences of an input sentence. For instance, if the linked list contains the sentence “The black cat was sitting on the black mat that was on the black floor”, and the input string for remove(string) is “on the black”, then the resulting linked list must be “The black cat was sitting mat that was floor”. 

 

For SENG1120 students who want to be challenged more, the above requirement becomes a bonus question, also worth 3.0 marks; however you can still only score a MAXIMUM of 

15.0/15.0. 

More products