My teacher said that my code so heavy , just told me to use array method to rewrite the insert data of part ........below is Node.h. And MySinglyList.h ........
#ifndef NODE_H
#define NODE_H
class Node
{
public: // Making all the data members
// data // as public is very exceptional.
double data; // Since this facilitates rapid
// pointer to next node // access of data members
Node* next;
};
#endif
#ifndef MYSINGLYLIST_H
#define MYSINGLYLIST_H
#include "SinglyList.h"
#include "Node.h"
class MySinglyList {
private:
SinglyList sLL;
public:
MySinglyList(); // Initialize nodes and call displayList() to display all nodes
void displayList(); // Call displayList() in SinglyList class to display all attached nodes
bool checkSortedOrder(); // Check linked list order. Return true if in ascending order
void addValue(double); // Add value to all nodes
void insertNodewith888(double); // Insert a new node with value 888 after any node that has the same input value
Node* moveLastNodeToBegin();
In other words, this is what your teacher gave you, and you have to rewrite the code according to the assignment?
Have you considered writing a function main() yourself? I still don't see it.