I gang

Doubly Linked Lists

struct Donut {

string flavor;

double price;

Donut* prev = NULL;

Donut* next = NULL;

Donut(){}

Donut(string flavor, double price);

void display();

};

struct DonutTray {

Donut* head = NULL;

Donut* tail = NULL;

int length = 0;

DonutTray(){}

void append(Donut* donut);

void prepend(Donut* donut);

void insert(Donut* donut, int index);

void remove(int index);

void display();

};

void DonutTray::append(Donut* donut) - appends the donut structure referenced by the donut pointer at the end of the donut tray updating head, tail, and length accordingly

void DonutTray::prepend(Donut* donut) - prepends the donut structure referenced by the donut pointer at the beginning of the donut tray updating head, trail, and length accordingly

void DonutTray::insert(Donut* donut, int index) - inserts the donut structure referenced by the donut pointer at the location indicated by the integer parameter index

void DonutTray::remove(int index) - removes the donut structure located at the location at index in the tray

Færdigheder: C++ Programmering

Se mere: linked int, append display, struct, head tail, remove trail, projects doubly linked lists, linked lists linked list java, implementing doubly linked lists java, linked lists, method doubly linked lists java, doubly linked lists examples java, java doubly linked list, struct integer, java doubly linked list implementation, java double linked lists, java doubly linked lists, doubly linked list java

Om arbejdsgiveren:
( 22 bedømmelser ) Cambridge, United States

Projekt-ID: #6030458

Tildelt til:

PeinOS

Hired by the Employer

$10 USD på 1 dag
(5 bedømmelser)
1.7