Question
Create a function name prependObj(). This works the same as the append, but it prepends the indicated integer parameter to the front of the list
Create a function name prependObj(). This works the same as the append, but it prepends the indicated integer parameter to the front of the list instead of to the end. However, you still need to check and grow your allocated memory before prepending if your list is currently full. Also prepend is a bit more complicated, because since we are implementing an array based list, you need to shift all of the current items 1 index up in your items before you can prepend to the beginning of the list. We will also overload the operator|() for our class to represent prepending an item. Thus if you do list | 5 this will cause 5 to be prepended to the beginning of the list.
Written in C++
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started