I am defining like this in eiffel to swap the value. We cannot use the way we define in c++.
swap(x,y):INTEGER
do
x;y := y;x
end
How to define functions in Eiffel? I want to define heap sort but it is showing some error can someone help me clear my doubt about function.
heapsort(array,N):INTEGER -- heap_sort
do
heap_size : INTEGER
heap_size := N
build(array,N)
from i := N until i >=2 loop
swap(array(1), array(i))
heap_size := heap_size-1
heapify(array,1,heap_size-1)
end
end