COP 4555 Lecture 4: COP4555 HW 4 Solutions

365 views5 pages
4 Jun 2015
School
Course
Professor

Document Summary

//do the inner product of u and v, using tail recursion. let rec accinner = function. | ( x :: xs , y :: ys , zs ) -> accinner ( xs , ys , ( x * y )+ zs) let inner xs ys = accinner ( xs , ys , 0 );; //mult let rec mult xs ys = match ys with. | ( _ :: _ ):: _ as ys -> ( inner xs ( list . map list . head ys )) :: ( mult xs ( list . map list . tail ys )) | _ -> [] let rec multiply ( xs , ys ) = match xs with. | ( x :: xs , y :: ys ) -> if x < y then x :: merge ( xs , y :: ys ) Else y :: merge ( x :: xs , ys ) let rec split = function.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents