#Add method error
1 messages ยท Page 1 of 1 (latest)
unfortunately we'll probably need to see the rest of the code
kk one sec
also what kind of data structure is this supposed to be?
need anything else?
no, i might leave it for someone else; im a bit busy atm
What does your program do?
I can't understand this instruction
It looks not complete. Seems like only a segment of the instruction
The instruction is still not complete
I can't spot the problem, but I think it might be helpful to change your MINIMUM_SIZE to 2 and hopefully this will make your debugging easier.
Why do you do this?
int middle = (l2.numUsed + 1) / 2;
l2.numUsed = 4
middle = (l2.numUsed + 1) / 2
middle = (4 + 1)/2
Why do you do (4+1)/2 instead of 4/2?
What's the point to plus one?
wait
can you actually see the test code?
๐
Set break point while running the failed test case to see what exactly is happening
- And you can check, in your failed test cases, what the
l1NumUsedis supposed to be. - test5 should be 8 and test12 should be 32 I guess
When you split L2Array, Should you keep the original length in both old and new array? You never shrink your L2Array. Are you supposed to shrink it under some circumstances?
You didn't grow your level 2 array neither
Using your current code, all of your level 2 array are always of size 4. Never grow to 8.
I don't know. The instruction should have mentioned it
But one thing I noticed is: In this figure, L2 array can be of size 8 and size 4, but your code just keeps everyone stay at size 4 forever
@woeful ledge
Your question has been closed due to inactivity.
If it was not resolved yet, feel free to just post a message below
to reopen it, or create a new thread.
Note that usually the reason for nobody calling back is that your
question may have been not well asked and hence no one felt confident
enough answering.
When you reopen the thread, try to use your time to improve the quality
of the question by elaborating, providing details, context, all relevant code
snippets, any errors you are getting, concrete examples and perhaps also some
screenshots. Share your attempt, explain the expected results and compare
them to the current results.
Also try to make the information easily accessible by sharing code
or assignment descriptions directly on Discord, not behind a link or
PDF-file; provide some guidance for long code snippets and ensure
the code is well formatted and has syntax highlighting. Kindly read through
https://stackoverflow.com/help/how-to-ask for more.
With enough info, someone knows the answer for sure ๐
@woeful ledge
Your question has been closed due to inactivity.
If it was not resolved yet, feel free to just post a message below
to reopen it, or create a new thread.
Note that usually the reason for nobody calling back is that your
question may have been not well asked and hence no one felt confident
enough answering.
When you reopen the thread, try to use your time to improve the quality
of the question by elaborating, providing details, context, all relevant code
snippets, any errors you are getting, concrete examples and perhaps also some
screenshots. Share your attempt, explain the expected results and compare
them to the current results.
Also try to make the information easily accessible by sharing code
or assignment descriptions directly on Discord, not behind a link or
PDF-file; provide some guidance for long code snippets and ensure
the code is well formatted and has syntax highlighting. Kindly read through
https://stackoverflow.com/help/how-to-ask for more.
With enough info, someone knows the answer for sure ๐