Difference between revisions of "Mutable List Assignment"

From CSE425S Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
=Code to Implement=
 
=Code to Implement=
 +
==create_mutable_list_from_immutable_list==
 
  fun create_mutable_list_from_immutable_list(xs) : 'a mutable_list =  
 
  fun create_mutable_list_from_immutable_list(xs) : 'a mutable_list =  
 
     raise NotYetImplemented
 
     raise NotYetImplemented
 
+
==create_empty_mutable_list==
 
  fun create_empty_mutable_list() : 'a mutable_list =  
 
  fun create_empty_mutable_list() : 'a mutable_list =  
 
     raise NotYetImplemented
 
     raise NotYetImplemented
  
 +
==create_mutable_list_from_other_mutable_list==
 
  fun create_mutable_list_from_other_mutable_list(ml) : 'a mutable_list =  
 
  fun create_mutable_list_from_other_mutable_list(ml) : 'a mutable_list =  
 
     raise NotYetImplemented
 
     raise NotYetImplemented
  
 +
==to_immutable==
 
  fun to_immutable(ml : 'a mutable_list) : 'a list =
 
  fun to_immutable(ml : 'a mutable_list) : 'a list =
 
     raise NotYetImplemented
 
     raise NotYetImplemented
  
 +
==length==
 
  fun length(ml : 'a mutable_list) : int =
 
  fun length(ml : 'a mutable_list) : int =
 
     raise NotYetImplemented
 
     raise NotYetImplemented
  
 +
==insert_at_front==
 
  fun insert_at_front(ml : 'a mutable_list, item : 'a) : unit =
 
  fun insert_at_front(ml : 'a mutable_list, item : 'a) : unit =
 
     raise NotYetImplemented
 
     raise NotYetImplemented
  
 +
==insert_at_back==
 
  fun insert_at_back(ml : 'a mutable_list, item : 'a) : unit =
 
  fun insert_at_back(ml : 'a mutable_list, item : 'a) : unit =
 
     raise NotYetImplemented
 
     raise NotYetImplemented
  
 +
==remove_first_match==
 
  fun remove_first_match(ml : ''a mutable_list, item : ''a) : bool =
 
  fun remove_first_match(ml : ''a mutable_list, item : ''a) : bool =
 
     raise NotYetImplemented
 
     raise NotYetImplemented
  
 +
==concat==
 
  fun concat(a : 'a mutable_list, b : 'a mutable_list) : unit =  
 
  fun concat(a : 'a mutable_list, b : 'a mutable_list) : unit =  
 
     raise NotYetImplemented
 
     raise NotYetImplemented
  
 +
==reverse==
 
  fun reverse(ml : 'a mutable_list) : unit =
 
  fun reverse(ml : 'a mutable_list) : unit =
 
     raise NotYetImplemented
 
     raise NotYetImplemented

Revision as of 06:22, 13 October 2020

Code to Implement

create_mutable_list_from_immutable_list

fun create_mutable_list_from_immutable_list(xs) : 'a mutable_list = 
   raise NotYetImplemented

create_empty_mutable_list

fun create_empty_mutable_list() : 'a mutable_list = 
   raise NotYetImplemented

create_mutable_list_from_other_mutable_list

fun create_mutable_list_from_other_mutable_list(ml) : 'a mutable_list = 
   raise NotYetImplemented

to_immutable

fun to_immutable(ml : 'a mutable_list) : 'a list =
   raise NotYetImplemented

length

fun length(ml : 'a mutable_list) : int =
   raise NotYetImplemented

insert_at_front

fun insert_at_front(ml : 'a mutable_list, item : 'a) : unit =
   raise NotYetImplemented

insert_at_back

fun insert_at_back(ml : 'a mutable_list, item : 'a) : unit =
   raise NotYetImplemented

remove_first_match

fun remove_first_match(ml : a mutable_list, item : a) : bool =
   raise NotYetImplemented

concat

fun concat(a : 'a mutable_list, b : 'a mutable_list) : unit = 
   raise NotYetImplemented

reverse

fun reverse(ml : 'a mutable_list) : unit =
   raise NotYetImplemented