Question: a ) Write a main ( ) routine in which you allocate nodes and create the following linked list. b ) Write a function called
a Write a main routine in which you allocate nodes and create the following linked list.
b Write a function called listSize that takes a pointer to the start of a linked list and returns
the number of elements in the list.
c Write another function called listSum that also takes a pointer to the start of a linked list
and returns the sum of the values of all elements in the list.
In your main routine, call and print out the results of these two functions.
d Question: If we want to change it to a circular linked list, what should we do
Question :
Assume nodes in a linked list are of class ListNode above, except that the type of data is char.
Write a main routine in which you create the following linked list:
Write a function called printList that takes a pointer to the start of a linked list and prints out all
the nodes in the list in sequence. The interface of this function is
Question : Doublylinked List
Revise Question to create a doublylinked list and design two functions:
traverseHeadTail Nodehead
traverseTaiHead Nodetail
In main test the two functions with the data from question
Question :
Design a template swap function with the following interface:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
