Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab 10 Instructions This lab contains four (4) necessary files: 1. Lab 10.cpp 2. Largest.h 3. Smallest.h 4. Hybrid.h (I did also include rBubble.h, just

Lab 10 Instructions This lab contains four (4) necessary files:

1. Lab 10.cpp 2. Largest.h 3. Smallest.h 4. Hybrid.h

(I did also include rBubble.h, just for reference.)

Item 1: Needs some slight modifications for the addition of Item 4, Hybrid.h. Items 2 and 3: (Smallest.h and Largest.h) Need to be written mostly by you, but you will find them to be a cinch, since I don't care in the least HOW you do it, and Google exists. I DO ask, however, that you use that block of code provided, AND that you write them in a recursive manner, hence the inclusion of the rBubble.h file -- just for reference. Item 4: Lastly, and by far most importantly, once you've written the smallest and largest functions, I want you to (somehow -- and it is COMPLETELY up to you how) -- in some creative way, COMPOSE them, to create a your own sorting algorithm. Incorporate the concept of recursive function calls as much as possible. This is what you will turn in as Hybrid.h and is worth at least as much as the other three files combined. If you do something that I find particularly impressive or clever, I will award extra credit pointsgenerously.

Largest.h code

// Your Name int largest(int x[], int num) { int temp, largest; // Find a place for this particular block code: if (x[i] /*Binary Operator here*/ x[i + 1]) { temp = x[i + 1]; x[i + 1] = x[i]; x[i] = temp; } ////////////////////////////////////////////// return largest; }

Smallest.h Code

// Your Name int smallest(int x[], int num) { int temp, smallest; // Find a place for this particular block code if (x[i] /*Binary Operator here*/ x[i + 1]) { temp = x[i + 1]; x[i + 1] = x[i]; x[i] = temp; } ////////////////////////////////////////////// return smallest; }

Hybrid.h Code

// Your Name int hybrid(int x[], int num) { int temp; /* */ // Code here */ return // Sorted List };

rBubble.h

// Your Name int temp; void Bubble(int x[], int num) { if (num == 1) { return; } for (int i = 0; i < num - 1; i++) { if (x[i] > x[i + 1]) { temp = x[i + 1]; x[i + 1] = x[i]; x[i] = temp; } } Bubble(x, num - 1); }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Sybase Database Administrators Handbook

Authors: Brian Hitchcock

1st Edition

0133574776, 978-0133574777

More Books

Students also viewed these Databases questions