Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write C program named bigint_dllist.h and bigint_dllist.c containing following structure and operation functions. Define a doubly linked list node structure NODE to hold a character

Write C program named bigint_dllist.h and bigint_dllist.c containing following structure and operation functions.

  1. Define a doubly linked list node structure NODE to hold a character data.
  2. NODE *new_node(char data); this creates a new node using malloc().
  3. void display_forward(NODE *start); this displays char data from start to end.
  4. void display_backward(NODE *end); this displays char data from end to start.
  5. void insert_start(NODE **startp, node **endp, node *new_np); this inserts a new node at the start the of doubly linked list.
  6. void insert_end(NODE **startp, node **endp, node *new_np); this inserts a new node at the end of the doubly linked list.
  7. void delete_start(NODE **startp, node **endp); this deletes the first node of the doubly linked list.
  8. void delete_end(NODE **startp, node **endp); this deletes the last node of the doubly linked list.
  9. void clean(NODE **startp, NODE **endp); this cleans the doubly linked list.

Use the main.c to test the above doubly linked list and operation functions.

main.c

#include "bigint_dllist.h" int main(int argc, char* args[]) { NODE *start = NULL, *end = NULL; int i=0; for (i = 0; i<10; i++) { insert_start(&start, &end, new_node('0'+i)); } display_forward(start); printf(" "); display_backward(end); delete_start(&start, &end); delete_end(&start, &end); printf(" "); display_forward(start); clean(&start, &end); for (i = 0; i<10; i++) { insert_end(&start, &end, new_node('a'+i)); } printf(" "); display_forward(start); clean(&start, &end); return 0; }

public test

 9 8 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9 8 7 6 5 4 3 2 1 a b c d e f g h i j

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Analytics And Quality Management Fundamental Tools

Authors: Joseph Nguyen

1st Edition

B0CNGG3Y2W, 979-8862833232

Students also viewed these Databases questions

Question

Describe the types of power that effective leaders employ

Answered: 1 week ago

Question

Describe how leadership styles should be adapted to the situation

Answered: 1 week ago