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

  A parking garage charges a $2.00 minimum

A parking garage charges a $2.00 minimum fee to park for up to three hours and an additional $0.50 per hour for each hour or part thereof over three hours.

  Write a program in c++ to read a text file

Write a program in C++ to read a text file (containing more than 500 words), count its alphabets, digits, special characters, capital and small letters, number prepositions and count for each word.

  Write a program that computes the total sales tax

Write a program that computes the total sales tax on a $52 purchase. Assume the state sales tax is 4 percent and the states sales tax is 4 percent and the country sales tax is 2 percent;

  Counts all occurrences of a given string from such a bag

Write a C++ function that removes and counts all occurrences of a given string from such a bag.

  Implement the chinese remainder theorem

This program must run in the Visual C++.NET. Some time I have problem with that, so, please the whole project included in the attached Zip file.

  Write a function named digit_name

Write a function named "digit_name" that takes an integer argument in the range from 1 to 9 , inclusive, and prints the English name for that integer on the computer screen.

  Two-dimensional array to compute the polar coordinates

Write a C program that will read from the input file the time, the x-coordinate, and the y-coordinate values into a two-dimensional array. The program will use the two-dimensional array to compute the polar coordinates.

  Write a code to draw epitrochoid and hypotrochoid

Write a code in C++ to draw Epitrochoid & Hypotrochoid using open GL. Consider the path traced by a point rigidly attached to a circle as the circle rolls around another fixed circle. These are called trochoids

  Prints out a multiplication table up to a specification

Create a program using C++ that prints out a multiplcation table up to a specfic limit. The code should prompt the user for the limit and then print out the table.

  Assign any new integer value entered by the user

Build a program that allows a user to select one of the following four menu options: enter new integer value, print pointer address, print integer address, and print integer value. For this program you will need to create two variables: one integer d..

  What are data declaration statements

I need an example of a flow chart and specification sheet of a C program.

  Why do such companies as ford, federal express

Why do such companies as Ford, Federal Express, Boeing, or Proctor & Gamble put together cross-functional teams?(a)  Because each member has unique knowledge that adds value to the overall decision(b)  Because it is cheaper than hiring consultants

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