I am taking the first part of Mosh’s data structures and algorithms course, and I am trying to create an adjustable array from scratch that can print, insert, find an index of, and remove at the index of. I am running into an error that I can’t find.
Worked fine on an online compiler. Try changing the name of your constructor parameter. Though on checking your functions you would find following issues (read comments):
Learn the language
Learn its programming practices
Keep the code readable
A few blank lines to group similar content do not have any issue on performance
Create a program to solve a problem
On successful creation, try to make it more readable
Parse your code manually and remove or modify commands for optimization
Keep the code readable
Practice to get comfortable in creating programs
Practice and understand what is happening in the code
Try to solve the mentioned problems on your own. I used an online compiler (as my drive is corrupt) so it took a while. Though I have modified your code to make it work, I will not paste the code here before you try to solve it. Try reading the documentation or Stack Overflow or other forums to get your programming query resolved.