Write the function splitList that takes the first argument list and splits it into two: a list of all the elements that are less than the head (the second argument), and a list of all the elements that are greater than or equal to the head (the third argument): listElementT splitList(listADT list, listADT* ItList, listADT* geList); Note that the head is returned by the function. a) Write this function as a recursive function. b) Write this function as a nonrecursive function.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter17: Linked Lists
Section: Chapter Questions
Problem 18PE
icon
Related questions
Question

Write the function splitList that takes the first argument list and splits it into two: a list of all the elements that are less than the head (the second argument), and a list of all the elements that are greater than or equal to the head (the third argument):

listElementT splitList(listADT list, listADT* ItList, listADT* geList);

Note that the head is returned by the function.

a) Write this function as a recursive function.

b) Write this function as a nonrecursive function. 

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Structure
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning