Hi there,
so I'm currently studying Java at my University and as of right now we're working on Linked Lists, Array lists, Array Deques, etc. As part of this lesson, we're being told to write our own versions, both recursive and iterative, of the predefined java functions for its corresponding data structure (such as addLast, contains, removeLast, etc).
I am finding this to be a little difficult as I tend to struggle with what the optimal logic would look like, but I was wondering in what situations would I be in where I would every need to create my own version as opposed to just using the predefined functions? Is this a common course of action?
I know that we're being taught this in order to have a better understanding of the logic behind the data structures, but I am just curious as to where I would absolutely need to edit the base Java functions for specific use.
Thank you!
EDIT: Just noticed the spelling error in the title. How embarrassing!