Question: please do it in c++ , and with the Algorithm Design Idea provide 4, Dancing Partner Matching(Queue)[Solution introduction: the second Problem: Match coming gentlemen and

please do it in c++ , and with the Algorithm Design Idea provide

please do it in c++ , and with the Algorithm Design Idea

4, Dancing Partner Matching(Queue)[Solution introduction: the second Problem: Match coming gentlemen and ladies. video in 3.6] What you need to show in the terminal(the back part is outputted by you and the blue part is inputted by the user, i.e., teacher): Please input coming dancers: [Problem description] In a ball, when gentlemen and ladies come, they form a queue of gentlemen Mark, male, 19 and a queue of ladies, respectively. When the ball starts, the gentlemen and Alice, female, 21 ladies who come first should get partners first. A gentleman should be matched Jenny, female, 23 with a lady. Similarly, a lady can only match with a gentleman. Write programs Bob, male, 20 to simulate the process of dancing partner matching. Andrew, male, 19 Julian, female, 18 The maximal number of coming gentlemen or ladies is 30. Ivan, male, 22 [Basic requirements] Jeff, male, 21 1) Use queues to solve this problem. [Example) Dancer partners are: Mark, Alice Bob, Jenny Andrew, Julian The following dancers do not have partners: Ivan, male, 22 Problem: Match coming gentlemen and ladies. Jeff, male, 21 What you need to show in the terminal(the back part is outputted by you

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!