Chapter 17: Problem 7
In a(n) __________ list, the last node has a pointer to the first node.
Chapter 17: Problem 7
In a(n) __________ list, the last node has a pointer to the first node.
All the tools & learning materials you need for study success - in one app.
Get started for freeTo indicate that a linked list is empty, you should set the pointer to its head to the value __________.
Write a function ListNode *ListConcat(ListNode *list1, ListNode *list2) That concatenates the items in list2 to the end of list1 and returns the resulting list.
Write a function double lastValue(ListNode *ptr) that returns the value stored in the last node of a nonempty list passed to it as parameter. The function should print an error message and terminate the program if the list passed to it is empty.
The __________ points to the first node in a linked list.
Using the ListNode structure introduced in this chapter, write a function void printFirst(ListNode *ptr) that prints the value stored in the first node of a list passed to it as parameter. The function should print an error message and terminate the program if the list passed to it is empty.
What do you think about this solution?
We value your feedback to improve our textbook solutions.