Question: void reverseListyString(ListyString *listy); Description: Reverse the linked list contained within listy. Be careful to guard against segfaults in the cases where listy is NULL or

void reverseListyString(ListyString *listy); Description: Reverse the linked list contained within listy. Be careful to guard against segfaults in the cases where listy is NULL or listy->head is NULL. Runtime Consideration: Ideally, this function should be O(n), where n is the length of the ListyString. Note that if you repeatedly remove the head of listys linked list and insert it at the tail of a new linked list using a slow tail insertion function, that could devolve into an O(n2) approach to solving this problem. Returns: Nothing. This is a void function.

Inside H file:

#ifndef __LISTY_STRING_H

#define __LISTY_STRING_H

typedef struct ListyNode

{

char data;

struct ListyNode *next;

} ListyNode;

typedef struct ListyString

{

ListyNode *head;

int length;

} ListyString;

int processInputFile(char *filename);

ListyString *createListyString(char *str);

ListyString *destroyListyString(ListyString *listy);

ListyString *cloneListyString(ListyString *listy);

void replaceChar(ListyString *listy, char key, char *str);

void reverseListyString(ListyString *listy);

ListyString *listyCat(ListyString *listy, char *str);

int listyCmp(ListyString *listy1, ListyString *listy2);

int listyLength(ListyString *listy);

void printListyString(ListyString *listy);

double difficultyRating(void);

double hoursSpent(void);

#endif

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!