vorherige Seite | 1 2 |
Gepostet: |
|||||||||||
Hmm, its very difficult to understand. Can you give us an example for each function you have to write (input and output)? And what is given - is it a list of digits (called ds) or sth. other? Heres some code for generating all permutations: perms :: Eq a => [a] -> [[a]] A permutation of a list is a list with the same elements in a different order. The perms function returns a list of all permutations of a list. The empty list has one permutation, itself. If xs is not empty, a permutation is given by picking an element x from xs and putting x at the front of a permutation of the remainder xs\\[x]. (The operation '\\' returns the difference of two lists: xs\\ys is the list xs with each element of ys removed, if its present.) I hope, this will help a little bit ;-) |
|||||||||||
Zum Seitenanfang | |||||||||||
Gepostet: |
|||||||||||
Thank yu for your reply Actually this is all that is given.....i.e. this is the only question given...nothing is associated with it...so one can assume any i/p he wants Your reply has helped quite a bit but even I am confused with what to write for this question... Happy new year regards John |
|||||||||||
Zum Seitenanfang | |||||||||||
Gepostet: |
|||||||||||
Hehe, now i understand the problem ;-) But theres still one question open. Should the formed number be divisible by the index k or by the digit that is at position k? I'll try to code this tomorrow. However, could you write for i/p what it means? I'm not familiar with this abbreviation... |
|||||||||||
Zum Seitenanfang | |||||||||||
Gepostet: |
|||||||||||
isDigit c = c >= '0' && c <= '9' use: Main> magic ['1','2','3'] "123" Main> magic "67" "76" Main> |
|||||||||||
Zum Seitenanfang | |||||||||||
Gepostet: |
|||||||||||
thanks a lot...yeah that is how it should be ....thank you very much....by the way i have a few more questions and was wondering if you are willing to do a few more coding...... Hav a great new year John |
|||||||||||
Zum Seitenanfang | |||||||||||
Gepostet: |
|||||||||||
you can post any other questions ;-) i will try my best... | |||||||||||
Zum Seitenanfang | |||||||||||
Gepostet: |
|||||||||||
Dear Jacke Actually I am doing my undergrad in aberdeen univ and they have given us such difficult questions in the holiday assignment......I want to pass so I need your help By the way...could you email me the answer coz if my professor by mistake sees it online in the public forum...i wil be kicked out of the university...... my email is john.youngalmighty@googlemail.com i hope you understand 1) give haskell and type of definition "merge" that merges two ordered list 2) give type and definition of function "member " such that "member xs x " returns True if "x" is an element of "xs" and False otherwise. thanks |
|||||||||||
Zum Seitenanfang | |||||||||||
Gepostet: |
|||||||||||
mergesort http://www.csc.depauw.edu/~bhoward/courses/0203Spring/csc122/haskintro/ isinlist [] x= False your prof cant find the posts with google ...try it ;-) |
|||||||||||
Zum Seitenanfang | |||||||||||
Gepostet: |
|||||||||||
Hmm, this page isn't currently indexed by google, but it won't take much time for them to index these posts as well. I suggest that you rewrite all code-passages to make it more difficult to find this page with google. |
|||||||||||
Zum Seitenanfang | Homepage ICQ | ||||||||||
Gepostet: |
|||||||||||
I don't think they will find it Thank you...I will come up with a few more i have not been able to do Regards John |
|||||||||||
Zum Seitenanfang | |||||||||||
vorherige Seite | 1 2 |