Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi, I need help with the function that is highlighted in yellow. In the function, I want to arrange the disks. For example, if I

Hi, I need help with the function that is highlighted in yellow. In the function, I want to arrange the disks. For example, if I have 4 dark disks and 5 light disks, I want the 5 light disks to be placed on the left side and 4 dark disks on the right side.

I don't know what to implement in order for this to happen. Please provide suggestions/tips.

I provided the hpp and cpp files below. Let me know if you need more info, Thanks.

hpp file

image text in transcribed

CPP file

image text in transcribed

class sorted_disks private: disk_state _after; unsigned _swap_count; disk_state _before; public: sorted_disks(const disk_state& after, unsigned swap_count) : _after(after), _swap_count (swap_count) sorted_disks(disk_state&& after, unsigned swap_count) : _after(after), _swap_count (swap_count) const disk_state& after) const f return after: unsigned swap_count() const { return swap count: // Algorithm that sorts disks using the left-to-right algorithm sorted disks sort_left to_right(const disk state& before) // TODO: Write code for this function, including rewriting the return / statement, and then delete these comments. return sorted-disks(before, 0)

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

Larry Ellison Database Genius Of Oracle

Authors: Craig Peters

1st Edition

0766019748, 978-0766019744

More Books

Students also viewed these Databases questions

Question

5. Develop the succession planning review.

Answered: 1 week ago