This code will be in C++ and will have 3 files. This lab will test your ability to use a custom stack class and a custom queue class. It will also test your ability to use a standard algorithm from STL. ReOrder ReOrder() takes three arguments as shown in Reorder.cpp. Complete this function using stack and queue. The number 0 is used as a delimiter between sets of numbers. The new array should have all negative numbers on one side and all positive numbers on the other side. The zero should be pushed to the end of the array. See the sample run below. Custom Compare Function The custom compare function is used in conjunction with the standard sort function. The numbers to be sorted are of a standard data type but create this custom compare function anyway. The function should result in a sorted array from the greatest number to the least number. Sample Run A sample run is as follows: array: -3 2 -1 5 1 -4 0 11 12 13 -11 -12 0 -1 -2 6 8 7 newArray: -3 -1 -4 1 5 2 -11 -12 13 12 11 -1 -2 7 8 6 0 0 newArray sorted: 13 12 11 8 7 6 5 2 1 0 0 -1 -1 -2 -3 -4 -11 -12   Be sure to document your code with the file name, your name and student number. Add comments throughout the code where necessary.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

This code will be in C++ and will have 3 files.

This lab will test your ability to use a custom stack class and a custom queue class. It will also test your ability to use a standard algorithm from STL.

ReOrder

ReOrder() takes three arguments as shown in Reorder.cpp. Complete this function using stack and queue. The number 0 is used as a delimiter between sets of numbers. The new array should have all negative numbers on one side and all positive numbers on the other side. The zero should be pushed to the end of the array. See the sample run below.

Custom Compare Function

The custom compare function is used in conjunction with the standard sort function. The numbers to be sorted are of a standard data type but create this custom compare function anyway. The function should result in a sorted array from the greatest number to the least number.

Sample Run

A sample run is as follows:

array: -3 2 -1 5 1 -4 0 11 12 13 -11 -12 0 -1 -2 6 8 7
newArray: -3 -1 -4 1 5 2 -11 -12 13 12 11 -1 -2 7 8 6 0 0
newArray sorted: 13 12 11 8 7 6 5 2 1 0 0 -1 -1 -2 -3 -4 -11 -12

 

Be sure to document your code with the file name, your name and student number. Add comments throughout the code where necessary.

Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Stack
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education