Cheney's algorithm: Difference between revisions

Content deleted Content added
No edit summary
Added Sample Algorithm in pseudo code
Line 20:
* '''Sample Algorithm.'''
 
initialize() =
tospace = 0
fromspace = N/2
allocPtr = tospace
 
allocate(n) =
If allocPtr + n > tospace + N/2
collect()
Line 36:
return o
 
collect() =
swap( fromspace, tospace )
allocPtr = tospace
root = copy(root)
 
copy(o) =
If o has no forwarding address
o’ = allocPtr