please help me write a function which will return the last element in an unsorted list.
the prototype of the function should be
ItemType ReturnLastItem();
we should assume that the list is not empty ans it shouldnt change after the program is executed..
pleeeeeeeeease help me
elsa87
0
Junior Poster in Training
Recommended Answers
Jump to PostShow some effort first and then people will help you. Don't expect others to do your work.
Just an idea: The class could contain a static pointer that would point to the last element. You could set it in the constructor.
Jump to Post>please help me write a function which will return the last element in an unsorted list.
How appropriately vague. When you say "last element", what do you mean? Do you mean the physical last item or the last sorted item? When you say "list", do you mean an array or …
Jump to Post>could u help me now?
I'd say no, since you answered neither of my questions.
Jump to PostShow us the definition of the "list".
Jump to PostWhat is IteamType?
All 20 Replies
minas1
1
Junior Poster in Training
elsa87
0
Junior Poster in Training
elsa87
0
Junior Poster in Training
Narue
5,707
Bad Cop
Team Colleague
elsa87
0
Junior Poster in Training
Narue
5,707
Bad Cop
Team Colleague
elsa87
0
Junior Poster in Training
minas1
1
Junior Poster in Training
elsa87
0
Junior Poster in Training
minas1
1
Junior Poster in Training
elsa87
0
Junior Poster in Training
minas1
1
Junior Poster in Training
elsa87
0
Junior Poster in Training
minas1
1
Junior Poster in Training
elsa87
0
Junior Poster in Training
minas1
1
Junior Poster in Training
elsa87
0
Junior Poster in Training
Narue
5,707
Bad Cop
Team Colleague
elsa87
0
Junior Poster in Training
minas1
commented:
Grow up.
+0
Narue
5,707
Bad Cop
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.