This is a c programming problem.
Would you please help me to write this problem???
I really appreciate it if you add comments for explanation step by step.
Thank you.

Code:
#include <stdio.h>
#include <stdlib.h>
struct Node
{
int value;
struct Node* prev;
struct Node* next;
};
struct Node* start = NULL;
struct Node* getNewNode(int val)
{
struct Node* newNode = (struct
Node*)malloc(sizeof(struct Node));
newNode->value = val;
newNode->prev = NULL;
newNode->next = NULL;
return newNode;
}
void insertAtBeginnning(struct Node* newNode)
{
if (start == NULL)
{
start = newNode;
}
else
{
start->prev = newNode;
newNode->next = start;
start = newNode;
}
}
void deleteLastNode()
{
struct Node* temp = start;
struct Node* prevNode = NULL;
while (temp->next != NULL)
{
prevNode = temp;
temp = temp->next;
}
prevNode->next = NULL;
free(temp);
}
void print()
{
printf("\n");
struct Node* temp = start;
while (temp != NULL)
{
if (temp->next == NULL)
printf("%d",
temp->value);
else
printf("%d
--> ", temp->value);
temp = temp->next;
}
}
void reverse(struct Node* aNode)
{
if (aNode->next == NULL)
{
//When it reaches the last node
assign the start pointer as the last node
start = aNode;
//Swap the prev pointer and the
next pointer of the last node
struct Node* temp =
aNode->prev;
aNode->prev =
aNode->next;
aNode->next = temp;
return;
}
//Call recursively till it reaches the last
node
reverse(aNode->next);
//Swap the prev pointer and the next pointer of all
the nodes during stack unwinding.
struct Node* temp = aNode->prev;
aNode->prev = aNode->next;
aNode->next = temp;
}
int main()
{
insertAtBeginnning(getNewNode(2));
insertAtBeginnning(getNewNode(4));
insertAtBeginnning(getNewNode(8));
insertAtBeginnning(getNewNode(10));
printf("\n Before reversing \n");
print();
printf("\n After reversing \n");
reverse(start);
print();
return 0;
}
OUTPUT:

This is a c programming problem. Would you please help me to write this problem??? I...
implement a doubly-linked list in C. Each node in the linked list should contain a string, a pointer to the previous node (or NULL), and a pointer to the next node (or NULL). The nodes should be sorted by their strings. struct node_t { char* str; struct node_t* prev; struct node_t* next; } To maintain the doubly-linked list, you should keep a pointer to the head node of the list (or NULL if the list is empty), and a pointer...
Programming in C: I am trying to modify this linked list to be doubly linked list. I’m also trying to add a print in reverse function. I’m really struggling with how to change the insert function to doubly link the nodes without effecting the alphabetical sorting mechanism. Example of desired output: Enter your choice: 1 to insert an element into the list. 2 to delete an element from the list. 3 to end. ? 1 Enter a character: a The...
CODE IN C++ Given: typedef char ItemType; // a struct type named NodeType that includes a ItemType and pointer // (to a NodeType) field struct NodeType { ItemType value; NodeType * next; }; bool Delete (NodeType * & firstPtr, ItemType value) { NodeType * prev, * cur; cur = Search (firstPtr, value, prev); if (cur==NULL) return false; else { // remove cur node from the linked list if (prev!=NULL) { //not the first one prev->next = cur->next;...
using C++, NOT C language 1. Write a function called insert() to insert a node to the beginning of a linked list. The data is passed into the function. For example insert(8) will insert a node at the beginning of the list with the number 8 in the data field. Each node in the linked list is a ListNode struct as discussed in class. 2. Write a function called print() that will traverse the entire linked list and print out...
14. p contains the elements 66, 9, 14, 52, 87, 14 and 17, in that order. Consider running the following line of code: p = question4(p); where question4 is the function defined below. Show the contents of p after the function call. struct node* question4(struct node *list) { struct node* a = list; struct node* b = list; struct node* c; if (a == NULL) return NULL; while ( a->next != NULL) a = a ->next; a->next = b; c...
14. p contains the elements 66, 9, 14, 52, 87, 14 and 17, in that order. Consider running the following line of code: p = question4(p); where question4 is the function defined below. Show the contents of p after the function call. struct node* question4(struct node *list) { struct node* a = list; struct node* b = list; struct node* c; if (a == NULL) return NULL; while ( a->next != NULL) a = a ->next; a->next = b; c...
Write a function to implement linked list consisting of five nodes. Store the data in the nodes in the order given below. Also, write a function to display the data stored in the implemented linked list. in C++ programming George, Paul, Ross, Joe, Elaine, Robert1 Insert three nodes in between second node and third node in the linked list that you implemented in problem 1. Store the following data in the new (inserted) nodes in the following order. (You have...
C++ Compsci 165: For your twelfth programming assignment you will be implementing a program that uses a linked list.You will be implementing the following structure and functions: struct LinkedList { int value; LinkedList *next; }; Note that with a singly linked list, you need to maintain a head pointer (pointer to the beginning of the list). Typically a tail pointer (pointer to the end of the list) is not maintained in a singly linked list (because you can only iterate...
C++ NEED HELP WITH MY REVERSE STRING FUNCTION IN LINK LIST A function Reverse, that traverses the linked list and prints the reverse text to the standard output, without changing the linked list. ( Pass the linked list by value, you have the freedom to create a doubly linked list that is a copy of the original list in your program before you call the function) #include "pch.h" #include <iostream> #include <string.h> #include <string> using namespace std; #define MAX 512...
[C++] Create three functions for a singly linked list: - Function 1: Insert a string into the linked list - Function 1: Insert a node after a given node (Node* curNodeptr, Node* newNodePtr) - Function 2: Delete the node passed to it by a pointer, it will take in the head and curPtr '(Node*, Node*)' struct Node{ string data; Node *next; };