Higher order insertion sort - HELP PLZ

hi,

can someone help me out, i need the code for below 2 functions:

Question)Implement the higher order insertion sort algorithm hoInsertSort which
is similar to insertion sort except that an element x is placed before an
element y if fun x b is a function taken
as input by higher order insertion sort. In other words, the result of
evaluating hoInsertSort fun xs should be a list [y1,y2,..., yn] such
that
fun y1

-- Higher order insertion sort
-- Hint: first write a function hoins that inserts an element
-- in the right place
hoins :: Ord b => (a -> b) -> a -> [a] -> [a]
//add your code here

-- The function hoInsertionSort sorts a list

hoInsertionSort :: Ord b => (a -> b) -> [a] -> [a]
//add your code here

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

[Community] OT

This is not an appropriate post for LtU.

Assuming it is not a homework question, you might want to try a Haskell specific mailing list or website.

Many basic texts on functional programming could also help you.