2017-05-22 13:26:21 +00:00
|
|
|
#include <stdio.h>
|
2017-05-23 08:45:31 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <assert.h>
|
2017-05-22 13:26:21 +00:00
|
|
|
|
2017-05-23 19:11:35 +00:00
|
|
|
#define STACK_TYPE double
|
|
|
|
#include "source/handystack.h"
|
|
|
|
|
|
|
|
#define LIST_TYPE float
|
|
|
|
#include "source/handylist.h"
|
|
|
|
|
|
|
|
void printList(float_list* list){
|
|
|
|
int size = size_float_list(list);
|
|
|
|
for (int i = 0; i < size; i++){
|
|
|
|
printf("\tIndex: %d, Value: %f\n", i, get_float_list(i, list));
|
|
|
|
}
|
|
|
|
for (int i = 0; i < 20; i++){
|
|
|
|
printf("-");
|
|
|
|
}
|
|
|
|
printf("\n");
|
|
|
|
}
|
|
|
|
|
2017-05-22 13:26:21 +00:00
|
|
|
int main(int argc, char* argv[]){
|
2017-05-23 08:45:31 +00:00
|
|
|
|
2017-05-23 19:11:35 +00:00
|
|
|
|
2017-05-23 08:45:31 +00:00
|
|
|
double_stack s = new_double_stack();
|
2017-05-23 16:02:10 +00:00
|
|
|
push_double_stack(42.5, &s);
|
2017-05-23 08:45:31 +00:00
|
|
|
print_double_stack(s);
|
|
|
|
|
2017-05-23 19:25:31 +00:00
|
|
|
float_list* l = new_float_list(-1, NULL);
|
|
|
|
printf("Start.\n");
|
|
|
|
for (int i = 0; i < 100000000; i++){
|
|
|
|
l = add_float_list(i*i, l);
|
|
|
|
}
|
|
|
|
printf("End.\n");
|
2017-05-23 16:02:10 +00:00
|
|
|
free_float_list(l);
|
|
|
|
|
2017-05-22 13:26:21 +00:00
|
|
|
}
|