Guest User

Untitled

a guest
Jan 19th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. function PARTITION(S; p)
  2. L;E;G Empty sequences
  3. x S:REMOVE(p)
  4. while :S:ISEMPTY() do
  5. y S:REMOVE(S:FIRST())
  6. if y < x then
  7. L:INSERTLAST(y)
  8. else if y = x then
  9. E:INSERTLAST(y)
  10. else
  11. G:INSERTLAST(y)
  12. return L;E;G
Add Comment
Please, Sign In to add comment