Assignment To Write A C Program That Implements A Singly Linked List

Posted Under: C

Ask A Question
DESCRIPTION
Posted
Modified
Viewed 23

Assignment to write a C program that implements a singly linked list.

Write a C program that implements a singly linked list. The list should be able to store integer values. Your program should have the following operations:

insert_at_head: This operation should add a new node at the head of the list with the given integer value.

insert_at_tail: This operation should add a new node at the tail of the list with the given integer value.

delete_at_head: This operation should delete the node at the head of the list and return the deleted value.

delete_at_tail: This operation should delete the node at the tail of the list and return the deleted value.

reverse: This operation should reverse the order of the list.

JSON Data Structure:

{ " LinkedList " : [ 4 , 6 , 2 ]} 

Assume that the input will be a valid JSON object as shown above. You can use any library for parsing JSON in C. The first line of input will contain an integer N, which denotes the number of operations to be performed on the list.

The next N lines will contain one of the above operations followed by an integer value if required.

Your program should print the required answer for each operation on a new line.

Attachments

No uploads for this question

Explanations and Answers 0

No answers posted

Post your Answer - free or at a fee

Login to your tutor account to post an answer

Posting a free answer earns you +20 points.

Login

NB: Post a homework question for free and get answers - free or paid homework help.

Get answers to: Assignment To Write A C Program That Implements A Singly Linked List or similar questions only at Tutlance.

Related Questions