SlideShare a Scribd company logo
C++ Sorting 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). 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. 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
Solution
Here is the solution for part(a):
int linked_list::MinLoc(node *head)
{
if(head == NULL)
return -1;
else if(head->next == NULL)
return head->info;
else
return (head->info < MinLoc(head->next) ? head->info : MinLoc(head->next));
}

More Related Content

Similar to C++ Sorting The parameter to the following two recursive routines is.pdf

Inspect the class declaration for a doubly-linked list node in Node-h-.pdf
Inspect the class declaration for a doubly-linked list node in Node-h-.pdfInspect the class declaration for a doubly-linked list node in Node-h-.pdf
Inspect the class declaration for a doubly-linked list node in Node-h-.pdf
vishalateen
 
Data Structure -List Stack Queue
Data Structure -List Stack QueueData Structure -List Stack Queue
Data Structure -List Stack Queue
surya pandian
 
csc211_lecture_21.pptx
csc211_lecture_21.pptxcsc211_lecture_21.pptx
csc211_lecture_21.pptx
ASADAHMAD811380
 
C++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdf
C++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdfC++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdf
C++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdf
poblettesedanoree498
 
Data structure using c module 1
Data structure using c module 1Data structure using c module 1
Data structure using c module 1
smruti sarangi
 
C Exam Help
C Exam Help C Exam Help
C Exam Help
Programming Exam Help
 
17 linkedlist (1)
17 linkedlist (1)17 linkedlist (1)
17 linkedlist (1)
Himadri Sen Gupta
 
In C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdf
In C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdfIn C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdf
In C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdf
stopgolook
 
Link list part 1
Link list part 1Link list part 1
Link list part 1
Anaya Zafar
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
JAGDEEPKUMAR23
 
Operations on linked list
Operations on linked listOperations on linked list
Operations on linked list
Sumathi Kv
 
هياكلبيانات
هياكلبياناتهياكلبيانات
هياكلبياناتRafal Edward
 
linked-list.ppt
linked-list.pptlinked-list.ppt
linked-list.ppt
DikkySuryadiSKomMKom
 
Daa chapter5
Daa chapter5Daa chapter5
Daa chapter5
B.Kirron Reddi
 
Ch 1 intriductions
Ch 1 intriductionsCh 1 intriductions
Ch 1 intriductionsirshad17
 
Need to be done in C++ Please Sorted number list implementation wit.pdf
Need to be done in C++  Please   Sorted number list implementation wit.pdfNeed to be done in C++  Please   Sorted number list implementation wit.pdf
Need to be done in C++ Please Sorted number list implementation wit.pdf
aathiauto
 
Singly Linked List_Operations-Traversal.pptx
Singly Linked List_Operations-Traversal.pptxSingly Linked List_Operations-Traversal.pptx
Singly Linked List_Operations-Traversal.pptx
ssusera965f6
 
data structures and algorithms Unit 3
data structures and algorithms Unit 3data structures and algorithms Unit 3
data structures and algorithms Unit 3
infanciaj
 
Address calculation-sort
Address calculation-sortAddress calculation-sort
Address calculation-sort
Vasim Pathan
 
Need to be done in C Please Sorted number list implementation with.pdf
Need to be done in C  Please   Sorted number list implementation with.pdfNeed to be done in C  Please   Sorted number list implementation with.pdf
Need to be done in C Please Sorted number list implementation with.pdf
aathmaproducts
 

Similar to C++ Sorting The parameter to the following two recursive routines is.pdf (20)

Inspect the class declaration for a doubly-linked list node in Node-h-.pdf
Inspect the class declaration for a doubly-linked list node in Node-h-.pdfInspect the class declaration for a doubly-linked list node in Node-h-.pdf
Inspect the class declaration for a doubly-linked list node in Node-h-.pdf
 
Data Structure -List Stack Queue
Data Structure -List Stack QueueData Structure -List Stack Queue
Data Structure -List Stack Queue
 
csc211_lecture_21.pptx
csc211_lecture_21.pptxcsc211_lecture_21.pptx
csc211_lecture_21.pptx
 
C++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdf
C++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdfC++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdf
C++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdf
 
Data structure using c module 1
Data structure using c module 1Data structure using c module 1
Data structure using c module 1
 
C Exam Help
C Exam Help C Exam Help
C Exam Help
 
17 linkedlist (1)
17 linkedlist (1)17 linkedlist (1)
17 linkedlist (1)
 
In C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdf
In C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdfIn C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdf
In C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdf
 
Link list part 1
Link list part 1Link list part 1
Link list part 1
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
 
Operations on linked list
Operations on linked listOperations on linked list
Operations on linked list
 
هياكلبيانات
هياكلبياناتهياكلبيانات
هياكلبيانات
 
linked-list.ppt
linked-list.pptlinked-list.ppt
linked-list.ppt
 
Daa chapter5
Daa chapter5Daa chapter5
Daa chapter5
 
Ch 1 intriductions
Ch 1 intriductionsCh 1 intriductions
Ch 1 intriductions
 
Need to be done in C++ Please Sorted number list implementation wit.pdf
Need to be done in C++  Please   Sorted number list implementation wit.pdfNeed to be done in C++  Please   Sorted number list implementation wit.pdf
Need to be done in C++ Please Sorted number list implementation wit.pdf
 
Singly Linked List_Operations-Traversal.pptx
Singly Linked List_Operations-Traversal.pptxSingly Linked List_Operations-Traversal.pptx
Singly Linked List_Operations-Traversal.pptx
 
data structures and algorithms Unit 3
data structures and algorithms Unit 3data structures and algorithms Unit 3
data structures and algorithms Unit 3
 
Address calculation-sort
Address calculation-sortAddress calculation-sort
Address calculation-sort
 
Need to be done in C Please Sorted number list implementation with.pdf
Need to be done in C  Please   Sorted number list implementation with.pdfNeed to be done in C  Please   Sorted number list implementation with.pdf
Need to be done in C Please Sorted number list implementation with.pdf
 

More from MALASADHNANI

I have two statistics questions, I was wondering if you could answer.pdf
I have two statistics questions, I was wondering if you could answer.pdfI have two statistics questions, I was wondering if you could answer.pdf
I have two statistics questions, I was wondering if you could answer.pdf
MALASADHNANI
 
How does increased transcription (mutation in the G1-S- checkpoint p.pdf
How does increased transcription (mutation in the G1-S- checkpoint p.pdfHow does increased transcription (mutation in the G1-S- checkpoint p.pdf
How does increased transcription (mutation in the G1-S- checkpoint p.pdf
MALASADHNANI
 
How many different phases would a 4-PSK modulated signal with the fo.pdf
How many different phases would a 4-PSK modulated signal with the fo.pdfHow many different phases would a 4-PSK modulated signal with the fo.pdf
How many different phases would a 4-PSK modulated signal with the fo.pdf
MALASADHNANI
 
how to get pure culture from mix culture. Microbiologyhow to.pdf
how to get pure culture from mix culture. Microbiologyhow to.pdfhow to get pure culture from mix culture. Microbiologyhow to.pdf
how to get pure culture from mix culture. Microbiologyhow to.pdf
MALASADHNANI
 
from mendels time to the 1950s, what were the three model organism.pdf
from mendels time to the 1950s, what were the three model organism.pdffrom mendels time to the 1950s, what were the three model organism.pdf
from mendels time to the 1950s, what were the three model organism.pdf
MALASADHNANI
 
File yuan.h#include iostream#include fstream#include .pdf
File yuan.h#include iostream#include fstream#include .pdfFile yuan.h#include iostream#include fstream#include .pdf
File yuan.h#include iostream#include fstream#include .pdf
MALASADHNANI
 
diastole; systole; atriaThe cardiac cycle refers to the rhythmic rel.pdf
diastole; systole; atriaThe cardiac cycle refers to the rhythmic rel.pdfdiastole; systole; atriaThe cardiac cycle refers to the rhythmic rel.pdf
diastole; systole; atriaThe cardiac cycle refers to the rhythmic rel.pdf
MALASADHNANI
 
Discuss how human activities influence some aspect of its life ando.pdf
Discuss how  human activities influence some aspect of its life ando.pdfDiscuss how  human activities influence some aspect of its life ando.pdf
Discuss how human activities influence some aspect of its life ando.pdf
MALASADHNANI
 
Early in my auditing career, I always wondered how do I know when .pdf
Early in my auditing career, I always wondered how do I know when .pdfEarly in my auditing career, I always wondered how do I know when .pdf
Early in my auditing career, I always wondered how do I know when .pdf
MALASADHNANI
 
Discus the development of the fraud examinerforensic accounting pro.pdf
Discus the development of the fraud examinerforensic accounting pro.pdfDiscus the development of the fraud examinerforensic accounting pro.pdf
Discus the development of the fraud examinerforensic accounting pro.pdf
MALASADHNANI
 
Could a cell survive by having just peripheral proteins on it’s memb.pdf
Could a cell survive by having just peripheral proteins on it’s memb.pdfCould a cell survive by having just peripheral proteins on it’s memb.pdf
Could a cell survive by having just peripheral proteins on it’s memb.pdf
MALASADHNANI
 
Define a class named Doctor whose objects are records for clinic’s d.pdf
Define a class named Doctor whose objects are records for clinic’s d.pdfDefine a class named Doctor whose objects are records for clinic’s d.pdf
Define a class named Doctor whose objects are records for clinic’s d.pdf
MALASADHNANI
 
cell nuclei experiment1. What is function of SDS and O.5M NaCl in .pdf
cell nuclei experiment1. What is function of SDS and O.5M NaCl in .pdfcell nuclei experiment1. What is function of SDS and O.5M NaCl in .pdf
cell nuclei experiment1. What is function of SDS and O.5M NaCl in .pdf
MALASADHNANI
 
Briefly discuss five criteria used to classify an organism as a multi.pdf
Briefly discuss five criteria used to classify an organism as a multi.pdfBriefly discuss five criteria used to classify an organism as a multi.pdf
Briefly discuss five criteria used to classify an organism as a multi.pdf
MALASADHNANI
 
Write a method countUnique that takes a List of integers as a parame.pdf
Write a method countUnique that takes a List of integers as a parame.pdfWrite a method countUnique that takes a List of integers as a parame.pdf
Write a method countUnique that takes a List of integers as a parame.pdf
MALASADHNANI
 
Which of the following statements about detritivores is true they a.pdf
Which of the following statements about detritivores is true  they a.pdfWhich of the following statements about detritivores is true  they a.pdf
Which of the following statements about detritivores is true they a.pdf
MALASADHNANI
 
What is the role of anaerobic cellular respiration in the nitrogen c.pdf
What is the role of anaerobic cellular respiration in the nitrogen c.pdfWhat is the role of anaerobic cellular respiration in the nitrogen c.pdf
What is the role of anaerobic cellular respiration in the nitrogen c.pdf
MALASADHNANI
 
What is on Important difference between genetic dissection and genomi.pdf
What is on Important difference between genetic dissection and genomi.pdfWhat is on Important difference between genetic dissection and genomi.pdf
What is on Important difference between genetic dissection and genomi.pdf
MALASADHNANI
 
Ralph has seven different colors of leftover paint. Since the.pdf
Ralph has seven different colors of leftover paint. Since the.pdfRalph has seven different colors of leftover paint. Since the.pdf
Ralph has seven different colors of leftover paint. Since the.pdf
MALASADHNANI
 
The following figure shows two possible groups of species on which to.pdf
The following figure shows two possible groups of species on which to.pdfThe following figure shows two possible groups of species on which to.pdf
The following figure shows two possible groups of species on which to.pdf
MALASADHNANI
 

More from MALASADHNANI (20)

I have two statistics questions, I was wondering if you could answer.pdf
I have two statistics questions, I was wondering if you could answer.pdfI have two statistics questions, I was wondering if you could answer.pdf
I have two statistics questions, I was wondering if you could answer.pdf
 
How does increased transcription (mutation in the G1-S- checkpoint p.pdf
How does increased transcription (mutation in the G1-S- checkpoint p.pdfHow does increased transcription (mutation in the G1-S- checkpoint p.pdf
How does increased transcription (mutation in the G1-S- checkpoint p.pdf
 
How many different phases would a 4-PSK modulated signal with the fo.pdf
How many different phases would a 4-PSK modulated signal with the fo.pdfHow many different phases would a 4-PSK modulated signal with the fo.pdf
How many different phases would a 4-PSK modulated signal with the fo.pdf
 
how to get pure culture from mix culture. Microbiologyhow to.pdf
how to get pure culture from mix culture. Microbiologyhow to.pdfhow to get pure culture from mix culture. Microbiologyhow to.pdf
how to get pure culture from mix culture. Microbiologyhow to.pdf
 
from mendels time to the 1950s, what were the three model organism.pdf
from mendels time to the 1950s, what were the three model organism.pdffrom mendels time to the 1950s, what were the three model organism.pdf
from mendels time to the 1950s, what were the three model organism.pdf
 
File yuan.h#include iostream#include fstream#include .pdf
File yuan.h#include iostream#include fstream#include .pdfFile yuan.h#include iostream#include fstream#include .pdf
File yuan.h#include iostream#include fstream#include .pdf
 
diastole; systole; atriaThe cardiac cycle refers to the rhythmic rel.pdf
diastole; systole; atriaThe cardiac cycle refers to the rhythmic rel.pdfdiastole; systole; atriaThe cardiac cycle refers to the rhythmic rel.pdf
diastole; systole; atriaThe cardiac cycle refers to the rhythmic rel.pdf
 
Discuss how human activities influence some aspect of its life ando.pdf
Discuss how  human activities influence some aspect of its life ando.pdfDiscuss how  human activities influence some aspect of its life ando.pdf
Discuss how human activities influence some aspect of its life ando.pdf
 
Early in my auditing career, I always wondered how do I know when .pdf
Early in my auditing career, I always wondered how do I know when .pdfEarly in my auditing career, I always wondered how do I know when .pdf
Early in my auditing career, I always wondered how do I know when .pdf
 
Discus the development of the fraud examinerforensic accounting pro.pdf
Discus the development of the fraud examinerforensic accounting pro.pdfDiscus the development of the fraud examinerforensic accounting pro.pdf
Discus the development of the fraud examinerforensic accounting pro.pdf
 
Could a cell survive by having just peripheral proteins on it’s memb.pdf
Could a cell survive by having just peripheral proteins on it’s memb.pdfCould a cell survive by having just peripheral proteins on it’s memb.pdf
Could a cell survive by having just peripheral proteins on it’s memb.pdf
 
Define a class named Doctor whose objects are records for clinic’s d.pdf
Define a class named Doctor whose objects are records for clinic’s d.pdfDefine a class named Doctor whose objects are records for clinic’s d.pdf
Define a class named Doctor whose objects are records for clinic’s d.pdf
 
cell nuclei experiment1. What is function of SDS and O.5M NaCl in .pdf
cell nuclei experiment1. What is function of SDS and O.5M NaCl in .pdfcell nuclei experiment1. What is function of SDS and O.5M NaCl in .pdf
cell nuclei experiment1. What is function of SDS and O.5M NaCl in .pdf
 
Briefly discuss five criteria used to classify an organism as a multi.pdf
Briefly discuss five criteria used to classify an organism as a multi.pdfBriefly discuss five criteria used to classify an organism as a multi.pdf
Briefly discuss five criteria used to classify an organism as a multi.pdf
 
Write a method countUnique that takes a List of integers as a parame.pdf
Write a method countUnique that takes a List of integers as a parame.pdfWrite a method countUnique that takes a List of integers as a parame.pdf
Write a method countUnique that takes a List of integers as a parame.pdf
 
Which of the following statements about detritivores is true they a.pdf
Which of the following statements about detritivores is true  they a.pdfWhich of the following statements about detritivores is true  they a.pdf
Which of the following statements about detritivores is true they a.pdf
 
What is the role of anaerobic cellular respiration in the nitrogen c.pdf
What is the role of anaerobic cellular respiration in the nitrogen c.pdfWhat is the role of anaerobic cellular respiration in the nitrogen c.pdf
What is the role of anaerobic cellular respiration in the nitrogen c.pdf
 
What is on Important difference between genetic dissection and genomi.pdf
What is on Important difference between genetic dissection and genomi.pdfWhat is on Important difference between genetic dissection and genomi.pdf
What is on Important difference between genetic dissection and genomi.pdf
 
Ralph has seven different colors of leftover paint. Since the.pdf
Ralph has seven different colors of leftover paint. Since the.pdfRalph has seven different colors of leftover paint. Since the.pdf
Ralph has seven different colors of leftover paint. Since the.pdf
 
The following figure shows two possible groups of species on which to.pdf
The following figure shows two possible groups of species on which to.pdfThe following figure shows two possible groups of species on which to.pdf
The following figure shows two possible groups of species on which to.pdf
 

Recently uploaded

The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 

Recently uploaded (20)

The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 

C++ Sorting The parameter to the following two recursive routines is.pdf

  • 1. C++ Sorting 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). 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. 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 Solution Here is the solution for part(a): int linked_list::MinLoc(node *head) { if(head == NULL) return -1; else if(head->next == NULL) return head->info; else return (head->info < MinLoc(head->next) ? head->info : MinLoc(head->next)); }