Let rec loop no int in loop qhead head q

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 120 / Spring 2012 21 [email protected] length Workspace Stack length begin match with! | None -> 0! | Some n -> 1 + (loop n.next)! end! q ( Heap fun (q:'a queue) ->! let rec loop (no:…) : int =! …! in! loop q.head ! )! head! q tail! loop v! ( )! 1! next! no v! 2! next! fun (no: …) ->! begin match no with! | None -> 0! | Some n -> 1 + (loop n.next)! end! CIS120 / Spring 2012 22 [email protected] length Workspace Stack length begin match with! | None -> 0! | Some n -> 1 + (loop n.next)! end! ? q ( Heap fun (q:'a queue) ->! let rec loop (no:…) : int =! …! in! loop q.head ! )! head! q tail! loop v! ( )! 1! next! no v! 2! next! fun (no: …) ->! begin match no with! | None -> 0! | Some n -> 1 + (loop n.next)! end! CIS120 / Spring 2012 23 [email protected] length Workspace Stack length begin match with! | None -> 0! | Some n -> 1 + (loop n.next)! end! ? q ( Heap fun (q:'a queue) ->! let rec loop (no:…...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online