When I was making a linked list in C++ for my university course, my professor told us to just use:
bool Stack::full() const{
return false; //Assume infinite memory
}
For our linked list implementations of the data structures we made in the class (stacks, lists, queues).
If you were to push something on to the stack and the stack is using the maximum amount of memory it can, this would cause the application to crash or do something weird right?
Is there a way to check that the linked list is full/out of memory? Or is it usually just assumed that linked lists will not grow to the size where they run out of memory?