SlideShare a Scribd company logo
1 of 1
Download to read offline
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-.pdfvishalateen
 
Data Structure -List Stack Queue
Data Structure -List Stack QueueData Structure -List Stack Queue
Data Structure -List Stack Queuesurya pandian
 
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.pdfpoblettesedanoree498
 
Data structure using c module 1
Data structure using c module 1Data structure using c module 1
Data structure using c module 1smruti sarangi
 
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.pdfstopgolook
 
Link list part 1
Link list part 1Link list part 1
Link list part 1Anaya Zafar
 
Operations on linked list
Operations on linked listOperations on linked list
Operations on linked listSumathi Kv
 
هياكلبيانات
هياكلبياناتهياكلبيانات
هياكلبياناتRafal Edward
 
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.pdfaathiauto
 
Singly Linked List_Operations-Traversal.pptx
Singly Linked List_Operations-Traversal.pptxSingly Linked List_Operations-Traversal.pptx
Singly Linked List_Operations-Traversal.pptxssusera965f6
 
data structures and algorithms Unit 3
data structures and algorithms Unit 3data structures and algorithms Unit 3
data structures and algorithms Unit 3infanciaj
 
Address calculation-sort
Address calculation-sortAddress calculation-sort
Address calculation-sortVasim 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.pdfaathmaproducts
 

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.pdfMALASADHNANI
 
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.pdfMALASADHNANI
 
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.pdfMALASADHNANI
 
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.pdfMALASADHNANI
 
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.pdfMALASADHNANI
 
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 .pdfMALASADHNANI
 
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.pdfMALASADHNANI
 
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.pdfMALASADHNANI
 
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 .pdfMALASADHNANI
 
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.pdfMALASADHNANI
 
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.pdfMALASADHNANI
 
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.pdfMALASADHNANI
 
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 .pdfMALASADHNANI
 
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.pdfMALASADHNANI
 
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.pdfMALASADHNANI
 
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.pdfMALASADHNANI
 
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.pdfMALASADHNANI
 
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.pdfMALASADHNANI
 
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.pdfMALASADHNANI
 
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.pdfMALASADHNANI
 

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

REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17Celine George
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17Celine George
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfstareducators107
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsNbelano25
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Philosophy of china and it's charactistics
Philosophy of china and it's charactisticsPhilosophy of china and it's charactistics
Philosophy of china and it's charactisticshameyhk98
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 

Recently uploaded (20)

REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Philosophy of china and it's charactistics
Philosophy of china and it's charactisticsPhilosophy of china and it's charactistics
Philosophy of china and it's charactistics
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 

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)); }