The parameter to the following two recursive routines is a pointer to a singly linked list of

Question:

The parameter to the following two recursive routines is a pointer to a singly linked list of numbers, whose elements are unique (no duplicates) and unsorted. Each node in the list contains two members, info (a number) and next (a pointer to the next node). 1. Write a recursive value-returning function, MinLoc, that receives a pointer to a list of unsorted numbers and returns a pointer to the node that contains the minimum value in the list. 2.

Write a recursive void function, Sort, that receives a pointer to an unsorted list of numbers and reorders the values in the list from smallest to largest.

This function may call the recursive MinLoc function that you wrote in part (a). (Hint: It is easier to swap the values in the info part of the nodes than to reorder the nodes in the list.)

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

C++ Plus Data Structures

ISBN: 9781284089189

6th Edition

Authors: Nell Dale, Chip Weems, Tim Richards

Question Posted: