We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Actually it is not deterministic for the allocator to always allocate memory at higher addresses. I belive that two nodes which are chronologically in order can reside in addresses which are of the reverse relation (the older node can have a lower address).
This kind of solution is heavily reliant on the storage provided for the linked list and the allocator at hand. The task does not specify this kind of information so it is incorrect to assume that this is a valid solution.
Cycle Detection
You are viewing a single comment's thread. Return to all comments →
Actually it is not deterministic for the allocator to always allocate memory at higher addresses. I belive that two nodes which are chronologically in order can reside in addresses which are of the reverse relation (the older node can have a lower address).
This kind of solution is heavily reliant on the storage provided for the linked list and the allocator at hand. The task does not specify this kind of information so it is incorrect to assume that this is a valid solution.