Z
Z
Z372014-02-14 20:57:21
C++ / C#
Z37, 2014-02-14 20:57:21

What is the maximum size of a doubly linked list in C?

What is the maximum size of a doubly linked list in C?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
tsarevfs, 2014-02-15
@Z37

The list element should contain 2 pointers (to the previous and next element) and the very useful information that you want to store there. For a 64 bit machine 2 * 8 + k bytes, where k is the user data size. If N bytes of memory are available (not necessarily operational in the general case), then we get no more than N / (16 + k) records.

L
leclecovich, 2014-02-14
@leclecovich

Double sided tape is available. And the list is doubly linked. More precisely, "a doubly linked list". It is also a double-linked list.
If we talk about C - it all depends on your implementation. There are no lists in C out of the box.
In C++, use max_size() to get the maximum possible number of elements in a list. It's about std::list.

N
nekipelov, 2014-02-14
@nekipelov

It depends on the amount of RAM available to the process and on the implementation of this list.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question