Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function PARTITION(S; p)
- L;E;G Empty sequences
- x S:REMOVE(p)
- while :S:ISEMPTY() do
- y S:REMOVE(S:FIRST())
- if y < x then
- L:INSERTLAST(y)
- else if y = x then
- E:INSERTLAST(y)
- else
- G:INSERTLAST(y)
- return L;E;G
Add Comment
Please, Sign In to add comment