0
$\begingroup$

I want to know where can I find some resources on this question, because, after researching for a day and half, I couldn't find information specific to my question. Can anyone help me answer my question? I know that dynamic data structures (such as linked lists) can expand the amount of nodes at runtime, but if that's the case, how could it ever return a "full error" message if has an unlimited amount of storage to get keep holding nodes inside of it?

$\endgroup$
2
$\begingroup$

I think this belongs more to StackOverflow than here.

As for your question, nothing in reality is unlimited. Computers have finite memory, finite storage. Words have a fixed (usually 32 or 64-bit) length, which might overflow. Or there might be some other engineering decision that limits the size of these data structures. Unlimited anything only exist in textbooks.

$\endgroup$
  • $\begingroup$ But never really answer the question; that's okay, because I figured it out myself. The only way it would return full is if the system operating system were to reach its full capacity or be exhausted. Care to add anything else to this conversation? $\endgroup$ – dorakta Oct 10 '17 at 17:54
  • $\begingroup$ That's exactly what @JohnDoeTheRighteous said: "Computers have finite memory". Maybe be more polite and/or grateful when someone answers your question? $\endgroup$ – charlesreid1 Oct 10 '17 at 20:41
  • $\begingroup$ With all due respect, I think your question was answered. "how could it ever return a "full error" message if has an unlimited amount of storage to get keep holding nodes inside of it?" is only true in textbooks, because nothing has an unlimited amount of storage. We don't know what system/language/implementation you were using that caused this error, but you likely got it because you exceeded some internal limit the programmer set for whatever reason. It's impossible to say anything more specific without details - which belongs to SO. $\endgroup$ – John Doe the Righteous Oct 10 '17 at 21:42
0
$\begingroup$

In addition to the previous answer by John Doe:

There's one more reason: "Dynamic" does not always mean "infinitely variable in size". A good example would be Q-Heaps by M. Fredman and D. E. Willard, which can only store up to $\mathcal{O}(w^{1\over 4})$ numbers when running on a $w$-bit system.

$\endgroup$
0
$\begingroup$

There are of course other reasons why a "data structure full" error code be returned. Three obvious possibilities are plain old bugs in the software, incorrect assumptions (like "users will never add a record over 100 KB to this list, so if they try it's a bug and we return 'data structure full'") and limitations in the software (like a 32 bit counter that mustn't overflow, which causes "data structure full" to be reported even when running on a 128 GB machine where there is plenty of memory still available).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.