1 Replies - 775 Views - Last Post: 09 November 2015 - 02:34 PM

#1 mohawke  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 09-November 15

Haskell Permutation Differnce

Posted 09 November 2015 - 12:12 PM

Hi guys, can you help me with finding the differnce between these to codes:

import Data.List
permHH [] = [[]]
permHH [a] = [[a]]
permHH as = [x:xs | x <- nub as, xs <- permHH (delete x as)]


and

permLL [] = [[]]
permLL as = [as!!(i-1):xs | i <- [1..length as],
xs <- permLL (take (i-1) as ++ drop i as)]



maybe i jsut need a hint because i tried many different list but i cant find a difference.
thanks 4 help

Is This A Good Question/Topic? 0
  • +

Replies To: Haskell Permutation Differnce

#2 sepp2k  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2499
  • View blog
  • Posts: 3,952
  • Joined: 21-June 11

Re: Haskell Permutation Differnce

Posted 09 November 2015 - 02:34 PM

One calls nub, the other doesn't.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1