Lucassim

Merge Oz

Jul 15th, 2013
516
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. declare
  2. fun {Merge L1 L2}
  3.    case L1 of
  4.       nil then L2      
  5.    [] H1|T1 then
  6.       case L2 of
  7.      nil then L1
  8.       [] H2|T2 then
  9.      if H1<H2 then
  10.         H1|{Merge T1 L2}
  11.      else
  12.         H2|{Merge L1 T2}
  13.      end
  14.       end
  15.    end
  16. end
  17.  
  18. {Browse {Merge [1 2 3 4 10] [2 3 22 40]}}
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×