Initialization
This commit is contained in:
parent
2e3044609b
commit
4d5fe17da0
62
cv4/list-ops.c
Normal file
62
cv4/list-ops.c
Normal file
@ -0,0 +1,62 @@
|
||||
#include "list_ops.h"
|
||||
|
||||
// constructs a new list
|
||||
list_t *new_list(size_t length, list_element_t elements[]){
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
||||
// append entries to a list and return the new list
|
||||
list_t *append_list(list_t *list1, list_t *list2){
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
||||
// filter list returning only values that satisfy the filter function
|
||||
list_t *filter_list(list_t *list, bool (*filter)(list_element_t)){
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
||||
// returns the length of the list
|
||||
size_t length_list(list_t *list){
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
// return a list of elements whose values equal the list value transformed by
|
||||
// the mapping function
|
||||
list_t *map_list(list_t *list, list_element_t (*map)(list_element_t)){
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
||||
// folds (reduces) the given list from the left with a function
|
||||
list_element_t foldl_list(list_t *list, list_element_t initial,
|
||||
list_element_t (*foldl)(list_element_t,
|
||||
list_element_t)){
|
||||
list_element_t res=0;
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
// folds (reduces) the given list from the right with a function
|
||||
list_element_t foldr_list(list_t *list, list_element_t initial,
|
||||
list_element_t (*foldr)(list_element_t,
|
||||
list_element_t)){
|
||||
list_element_t res=0;
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
// reverse the elements of the list
|
||||
list_t *reverse_list(list_t *list){
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
||||
// destroy the entire list
|
||||
// list will be a dangling pointer after calling this method on it
|
||||
void delete_list(list_t *list){
|
||||
|
||||
}
|
61
cv4/list_ops.c
Normal file
61
cv4/list_ops.c
Normal file
@ -0,0 +1,61 @@
|
||||
#include "list_ops.h"
|
||||
|
||||
// comstruct a new list
|
||||
|
||||
list_t *new_list(size_t lenght, list_element_t elements[]){
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// append entries to a new list and return the new list
|
||||
|
||||
list_t *append_list(list_t *list1, list_t *list2){
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//filter list returninf only values that satisfy the filter function
|
||||
|
||||
list_t *filter_list(list_t *list, bool (*filter)(list_element_t)){
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//returns the lenght of the list
|
||||
|
||||
size_t lenght_list(list_t *list){
|
||||
return 0;
|
||||
}
|
||||
|
||||
//return a list of elements whose values equal the list value transformed by
|
||||
//the maaping function
|
||||
|
||||
list_t *map_list(list_t *list, list_element_t (*map)(list_element_t)){
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//folds (reduces) the given list from the left with a function
|
||||
|
||||
list_element_t foldl_list(list_t *list, list_element_t initial, list_element_t (*foldl)(list_element_t,
|
||||
list_element_t)){
|
||||
list_element_t res=0;
|
||||
return res;
|
||||
}
|
||||
|
||||
//folds (reduces) the given list from the right with a function
|
||||
|
||||
list_element_t foldr_list(list_t *list, list_element_t initial, list_element_t (*foldr)(list_element_t,
|
||||
list_element_t)){
|
||||
list_element_t res=0;
|
||||
return res;
|
||||
}
|
||||
|
||||
//reverse elements of the list
|
||||
|
||||
list_t *reserve_list(list_t *list){
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//destroy the entire list
|
||||
//list will ve a dangling pointer after calling this method on it
|
||||
|
||||
void delete_list(list_t list*){
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user