Head head q tail v 1 next v 2 next cis120

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: length Workspace length q! Stack length q Heap fun (q:'a queue) ->! let rec loop (no:…) : int =! …! in! loop q.head ! head! tail! v! 1! next! v! 2! next! CIS120 / Spring 2012 12 [email protected] length Workspace length q! Stack length q Heap fun (q:'a queue) ->! let rec loop (no:…) : int =! …! in! loop q.head ! head! tail! v! 1! next! v! 2! next! CIS120 / Spring 2012 13 [email protected] length Workspace q! Stack length q Heap fun (q:'a queue) ->! let rec loop (no:…) : int =! …! in! loop q.head ! head! tail! v! 1! next! v! 2! next! CIS120 / Spring 2012 14 [email protected] length Workspace ( )! Stack length q Heap fun (q:'a queue) ->! let rec loop (no:…) : int =! …! in! loop q.head ! head! tail! v! 1! next! v! 2! next! CIS120 / Spring 2012 15 [email protected] length Workspace let rec loop (no: …) : int =! begin match no with! | None -> 0! | Some n -> 1 + (loop n.next)! end! in! loop...
View Full Document

This document was uploaded on 11/24/2013.

Ask a homework question - tutors are online