Ok, so I have to make a linked list for my school assignment and i can't use the std lib to make it. Im having trouble making it although I understand the concept.
there are two components to my node class(value and next pointer). Currently I am working on the function to add a new node to the beginning of the List. I need many more functions but am so stuck I can use any help i can get. THANKS!
As u can see, my insertfront function is an absolute mess, but I can't really figure out what to do...
MAIN.cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <iostream>
#include <stddef.h>
#include <Staque.cpp>
usingnamespace std;
int main()
{
int entry;
cout<<"welcome to my program"<<endl;
cout<<"please enter a number to enter to my list!"<<endl;
cin>>entry;
Staque.InsertFront(entry);
Staque.Display();
return 1;
}
Little bit confused as to what you want here. Your title suggests a linked list, your class name is stack and your functions look like that of a deque.
Which is it precisely? Are you sure you understand the concept of a linked list? Because this post suggests that you're mixing the general principles of the three structures mentioned.