mirror of
https://github.com/iritmaximus/haskell.git
synced 2026-10-12 19:13:39 +03:00
swap aidosti ykösel
This commit is contained in:
+1
-1
@@ -253,7 +253,7 @@ transfer from to amount bank | Map.notMember from bank = bank
|
||||
-- ==> array (1,4) [(1,"one"),(2,"three"),(3,"two"),(4,"four")]
|
||||
|
||||
swap :: Ix i => i -> i -> Array i a -> Array i a
|
||||
swap i j arr = todo
|
||||
swap i j arr = arr // ([(i, arr ! j), (j, arr ! i)])
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
-- Ex 12: given an Array, find the index of the largest element. You
|
||||
|
||||
Reference in New Issue
Block a user