Use the following structure as the node type for implementing a linked list:
#define MAX_WORD 30
typedef struct _listnode {
char word[MAX_WORD];
struct _listnode *pNext;
} WordNode;
Read all the words from a file called words.txt. Place each word in the list by adding them to the end of the list. Add the words to the list in the order they were read from the file.
Each node in the list must be created using malloc.
Once the list is populated with all the words from the file, print the word list in the order the words appear in the list.
Use the following structure as the node type for implementing a linked list:
#define MAX_WORD 30
typedef struct _listnode {
char word[MAX_WORD];
struct _listnode *pNext;
} WordNode;
Read all the words from a file called words.txt. Place each word in the list by adding them to the list in SORTED order. The list should contain an alphabetically sorted list of the words from the file words.txt.
Each node in the list must be created using malloc.
Once the list is populated with all the words from the file, print the word list in the order the words appear in the list.
Implement a circular queue by writing circular.h and circular.c.
Here are the contents of circular.h:
#define QUEUE_SIZE 100
typedef struct {
int head;
int tail;
int count;
int data[QUEUE_SIZE];
} CircularQueue;
void CircularInitialize(CircularQueue *q);
void CircularEnqueue(CircularQueue *q, int value);
int CircularDequeue(CircularQueue *q, int *pValue);
Using an array, implement a circular queue of up to 100 elements. Implement CircularEnqueue() and CircularDequeue() functions to place numbers on the queue and read them from the queue tail. A circular queue only saves the last n entries (where n is the number of elements in the queue). Overwrite the oldest entries with newest entries once the queue is full.
A main.c and makefile is supplied. The main.c source file contains a set of tests that verify your implementation is correct.