Programming Project #5 EGRE246 Spring 2021 Doubly Linked List ADT (revised 3/2/21) 1 Overview This project entails you implementing a generic doubly-linked list ADT dllist in C with a header node as...

write C programing program, should follow strictly the PDF. the dllist. h is given and you need to write a dllist.c and a drive.c to test it if the program is working


Programming Project #5 EGRE246 Spring 2021 Doubly Linked List ADT (revised 3/2/21) 1 Overview This project entails you implementing a generic doubly-linked list ADT dllist in C with a header node as pictured below. (list nodes) // 2 4 6 ... head tail dllist l; l (header node) Here is file dllist.h (downloadable off the class Canvas pages): #include #ifndef DLLIST_H #define DLLIST_H typedef struct header *dllist; dllist createList(void); // returns a newly created empty list; must be called before // using list routines void destroyList(dllist dl); // deallocates entire list (the nodes; does not free data); operation undefined if list // hasn’t been created with createList; does nothing if dl==NULL. List is undefined // after operation. void clearList(dllist dl); // deallocates list items (nodes only, not data) (if applicable) and sets list to empty, // does nothing if dl==NULL 1 void *getItem(dllist,int); // returns item at location if it exists, otherwise // returns NULL int addItem(dllist,void *item); // adds item to end of list; item should be created at // runtime with malloc (in order for it to be free’ed later). // Returns index of new item or -1 if add was unsuccesful int insertItem(dllist l,int i,void * item); // inserts item into list at position i; item should be created // at runtime with malloc (in order for it to be free’ed later). // Returns index of new item or -1 if unsuccessful; operation is // successful when 0 <= i=""><= listsize(l) (0 is the first item in // the list) bool removeitem(dllist,int i); // removes node from list at position i and deallocates it (does not free the data), // returns true if operation successful, false otherwise bool setitem(dllist,int loc,void *); // replaces (overwrites) item in list at position loc, returns // true if operation is succesful, false otherwise int listsize(dllist); // returns current number of items in list bool listempty(dllist); // returns true if list is empty, false otherwise #endif you may not modify this file. you have may define your two node structures (i.e. your header and list nodes) in any way that you choose as long as you implement a header node structure pointing to both the head and tail of a doubly-linked list. your data should be of type void * to allow data of any type to be stored in the list. note that all memory management of the data is left to the user of the module – your code should not free up any actual data stored in your container. 2 deliverables turn in only your c source code file via gradescope. document your code in the same way you have done previous projects. due date: april 15 2 listsize(l)="" (0="" is="" the="" first="" item="" in="" the="" list)="" bool="" removeitem(dllist,int="" i);="" removes="" node="" from="" list="" at="" position="" i="" and="" deallocates="" it="" (does="" not="" free="" the="" data),="" returns="" true="" if="" operation="" successful,="" false="" otherwise="" bool="" setitem(dllist,int="" loc,void="" *);="" replaces="" (overwrites)="" item="" in="" list="" at="" position="" loc,="" returns="" true="" if="" operation="" is="" succesful,="" false="" otherwise="" int="" listsize(dllist);="" returns="" current="" number="" of="" items="" in="" list="" bool="" listempty(dllist);="" returns="" true="" if="" list="" is="" empty,="" false="" otherwise="" #endif="" you="" may="" not="" modify="" this="" file.="" you="" have="" may="" define="" your="" two="" node="" structures="" (i.e.="" your="" header="" and="" list="" nodes)="" in="" any="" way="" that="" you="" choose="" as="" long="" as="" you="" implement="" a="" header="" node="" structure="" pointing="" to="" both="" the="" head="" and="" tail="" of="" a="" doubly-linked="" list.="" your="" data="" should="" be="" of="" type="" void="" *="" to="" allow="" data="" of="" any="" type="" to="" be="" stored="" in="" the="" list.="" note="" that="" all="" memory="" management="" of="" the="" data="" is="" left="" to="" the="" user="" of="" the="" module="" –="" your="" code="" should="" not="" free="" up="" any="" actual="" data="" stored="" in="" your="" container.="" 2="" deliverables="" turn="" in="" only="" your="" c="" source="" code="" file="" via="" gradescope.="" document="" your="" code="" in="" the="" same="" way="" you="" have="" done="" previous="" projects.="" due="" date:="" april="" 15="">
Apr 07, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here