typedef struct list_node list_node;
typedef list_node *linked_list;
struct list_node {
int data;
list_node *next;
};
Write a function which tests if a specified value is a found in a specified list, i.e. the function should return 1 if the value occurs in the list 0 otherwise. Your functions should have this prototype:
int member(int value, linked_list list);
typedef struct list_node list_node;
typedef list_node *linked_list;
struct list_node {
int data;
list_node *next;
};
Write a function which takes a string containing a list of integers in Haskell syntax, e.g "[3,42,-5]", and returns the equivalent linked list. Your function should have this prototype:
linked_list string_to_list(char *s);
typedef struct list_node list_node;
typedef list_node *linked_list;
struct list_node {
int data;
list_node *next;
};
Write a function which takes a linked list returns a string describing the list in Haskell syntax. The string should be malloc'ed. Your function should have this prototype:
char *list_to_string(linked_list list);