Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In class, we have studied the singly linked list, implemented as follows: (Code can be found in the accompanying .c le) #include #include typedef struct

In class, we have studied the singly linked list, implemented as follows: (Code can be found in the accompanying .c le)

#include #include

typedef struct _node { int data; struct _node * next; } node_t;

typedef struct { node_t * head; node_t * tail; } LL_t;

LL_t * LLcreate() { LL_t * ret = malloc(sizeof(LL_t)); ret->head = NULL; ret->tail = NULL; return ret; }

void LLappend(LL_t * intlist, int value) { node_t * newNode = malloc(sizeof(node_t));

newNode->data = value; newNode->next = NULL;

if (intlist->head == NULL) { intlist->head = newNode; intlist->tail = newNode; } else { intlist->tail->next = newNode; intlist->tail = newNode; } }

Part a) Implement a function LLMax to return the biggest number in the linked list. For example, if a linked list has the elements {5, 100, -100, 2019}, the function LLMax should return 2019. If the linked list is empty, the function should return any integer of your choice, and display the message Empty List! The function prototype is given below. // Returns the biggest number in the LL t int LLMax(LL t i n t l i s t ) { } Part b) Implement a function LLDelete which removes all occurrences of a target number if it is found in the linked list, and displays Value not found if the target number is not found. The function prototype is given below. // Deletes the node containing the target integer , and // warns user i f the target is not found void LLDelete (LL t intlist , int target ) { }

*****Please also provide me a main function in .c format to test the functions. Thanks!

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

Students also viewed these Databases questions

Question

6. Write a job specification.

Answered: 1 week ago