Commit f26e0a2a authored by Lindsay Knupp's avatar Lindsay Knupp
Browse files

La 7 completed

parent 9ea0d618
......@@ -24,7 +24,6 @@
#include "dlist.h"
int main(int argc, char *argv[]) {
// char *mystr;
struct dlist *mylist = dlist_create();
printf("dlisttest running...\n");
......@@ -85,30 +84,19 @@ int main(int argc, char *argv[]) {
dlist_print(mylist);
printf("\ntesting remove front\n");
// mystr = dlist_remove_front(mylist);
// printf("removed string = %s\n", mystr);
// free(mystr);
printf("list length= %d\n\n", dlist_num_elems(mylist));
dlist_print(mylist);
printf("\ntesting remove back\n");
// mystr = dlist_remove_back(mylist);
// printf("removed string = %s\n", mystr);
// free(mystr);
printf("list length= %d\n\n", dlist_num_elems(mylist));
dlist_print(mylist);
printf("\ntesting find_remove\n");
// mystr = dlist_find_remove(mylist, str3);
// printf("removed string = %s\n", mystr);
// free(mystr);
printf("contents of the list\n");
dlist_print(mylist);
dlist_print(mylist);
}
......@@ -46,7 +46,6 @@ int main(int argc, char *argv[]){
dlist_print(allocated_list);
printf("\nAllocating 200\n");
allocate(200,0);
......@@ -57,7 +56,6 @@ int main(int argc, char *argv[]){
printf("allocated-list\n");
dlist_print(allocated_list);
//printf("\n------Deallocating node------\n");
printf("\nDeallocating 50\n");
deallocate(ptr1);
......@@ -79,4 +77,16 @@ int main(int argc, char *argv[]){
printf("allocated-list\n");
dlist_print(allocated_list);
printf("\nAllocating 700\n");
allocate(700,0);
printf("\nLISTS SHOULD BE THE SAME");
printf("\nfree-list\n");
dlist_print(free_list);
printf("allocated-list\n");
dlist_print(allocated_list);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment