Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- insertHeap(Heap={Zh, L, R}, E, Steps = [l|_]) when E > Zh ->
- {E, Lneu={Zh, {},{} }, {}};
- insertHeap(Heap={Zh, L, R}, E, Steps = [r|_]) when E > Zh ->
- {E, L, {Rneu=Zh,{},{}}};
- insertHeap(Heap={Zh, L, R}, E, Steps = [l|_]) when E =< Zh ->
- {Zh, Lneu={E, {},{} }, {}};
- insertHeap(Heap={Zh, L, R}, E, Steps = [r|_]) when E =< Zh ->
- {Zh, L, {Rneu=E,{},{}}};
- insertHeap(Heap={Zh, L, R}, E, Steps = [l|T]) when E > Zh ->
- {E, insertHeap(L,Zh, T), R};
- insertHeap(Heap={Zh, L, R}, E, Steps = [r|T]) when E > Zh ->
- {E, L, insertHeap(R,Zh, T)};
- insertHeap(Heap={Zh, L, R}, E, Steps = [l|T]) when E =< Zh ->
- {Zh, insertHeap(L,E, T), R};
- insertHeap(Heap={Zh, L, R}, E, Steps = [r|T]) when E =< Zh ->
- {Zh, L, insertHeap(R,E, T)};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement