Linked lists programming

Assignment Help C/C++ Programming
Reference no: EM131860348

Linked Lists Programming in C -

Insert a new list node with the given value right after the specified node.  The next pointer of the head node should point to the new node, and the next pointer of the new node should point to the old next pointer of the head node.

Use alloc_node to create a new node. Don't forget to set its value!

Return a pointer to the last node in a linked list, starting from the given head node.  If the list only consists of the head node (i.e. the head node's next pointer is null), then simply return the head node pointer.

If the head node pointer refers to the node with the value 0, list_end(head) should return a pointer to the node with the value of 2.

Return the number of nodes in a linked list, starting from the given head pointer.  Since the head pointer is always non-null, the size of a list will be at least 1.

If the head node pointer refers to the node with the value 0, list_size(head) should return 3.  If the head node pointer refers to the node with the value 1, list_size(head) should return 2.

Return a pointer to the first node in the given linked list (starting at head) with the specified value, and store the pointer to its predecessor node at predp.  If no such node exists, return NULL and set the predecessor to NULL as well.

If the head pointer refers to the node with the value 0, and predp points to a local struct list_node pointer variable, then a call to list_find(head, 2, predp) should return a pointer to the node with the value of 2 and the predecessor pointer should point to the node with the value of 1.

If the head node contains the sought-after value, then the predecessor pointer should be set to NULL.

Remove a node from the given linked list (starting at the given head) with the specified value.  Return 1 if a node was removed and 0 otherwise.  If the node removed is the head node, then set the pointer to the head pointer to point to the new list head (which should be head->next).  Use free_node on the removed node.

Note that instead of a pointer to a node, the passed head pointer "headp" is actually a pointer to a pointer.  To get the pointer to the head node, you will need to dereference it.  A pointer to a pointer is passed so that the value of the head node pointer can be changed if the head node is removed.

Attachment:- Assignment File.rar

Reference no: EM131860348

Questions Cloud

How large a sample should be selected so that the margin : How large a sample should be selected so that the margin of error of estimate for a 99% confidence interval for µ is 2.50?
How much value did management add to stockholder wealth : Gourmet Kitchen Products reported $22 million of sales and $18 million of operating costs. how much value did management add to stockholders' wealth during 2016
Determine the sample size for the estimate : Can you help me with the following and explain how did you get the result?
Prepare a CPM that includes hershey and mars and nestle : What does your CPM Matrix tell you about Hershey and its competitors? Did you compare and contrast each company's score in your discussion of the results?
Linked lists programming : Linked Lists Programming in C - Insert a new list node with the given value right after the specified node. Return a pointer to the last node in a linked list
Discuss the strategies to resolve issues that you identify : Discuss the strategies to resolve issues that you identify. Research and discuss at least two approaches to solving this problem.
Determining the probability that a tire would have lifespan : Suppose that the population mean is 60,000 miles, and the standard deviation has been determined to be 8,000 miles. Imagine you're interested
Presentation - aspect of social media use in the workplace : Develop a PowerPoint presentation (12-18 slides in length). It should include a title slide, an agenda slide, body content slides, a closing slide
What are the pro and con of capital asset pricing model : What are the pro’s and con’s of the capital asset pricing model (CAPM)? Why is it so difficult to develop a formula for pricing stocks?

Reviews

len1860348

2/12/2018 1:52:05 AM

Instructions in the file as comments. Completely new to C programming, but have Java experience. I understand linked lists, just not how to code into C. Hint: Use list_find to get the node to remove and its predecessor, then manipulate the next pointers of the nodes to restructure the list. Hint: Don't forget to call free_node! Hint: Don't forget to set the new pointer to the head node if the head node is removed.

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd