#Add method error

1 messages ยท Page 1 of 1 (latest)

cosmic stirrupBOT
#

<@&987246399047479336> please have a look, thanks.

abstract nest
#

unfortunately we'll probably need to see the rest of the code

abstract nest
#

also what kind of data structure is this supposed to be?

woeful ledge
abstract nest
dawn nova
#

What does your program do?

#

I can't understand this instruction

#

It looks not complete. Seems like only a segment of the instruction

dawn nova
#

The instruction is still not complete

dawn nova
#

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
dawn nova
#

What's the point to plus one?

dawn nova
#

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 l1NumUsed is 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

cosmic stirrupBOT
#

@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 ๐Ÿ‘

cosmic stirrupBOT
#

@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 ๐Ÿ‘