Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Objective: The objective of this site is to give you practice in implementing fairly single algorithm interite data structure Your Task: For this sciment you

image text in transcribed
image text in transcribed
image text in transcribed
Objective: The objective of this site is to give you practice in implementing fairly single algorithm interite data structure Your Task: For this sciment you will do import Gale Staples Algorithm for finding a stable matching for simplicity, instead of wing us, we will see that the men are wumbered through and similarly, the numbered through 1. Yout program should output the matinal table matching produced by the Gule Shapley Algorithm. Your implementation should be in intime You are expected to write the whole program (including implementation of data struct tres involved yourself and not being of functions from the libraries or from public domain out there Data Structures. I want to make sure that all you are comfortable in line with diferent data structure the link list to post the preference lists of mente an arwy data structure to represent the prices of women are a stack data structure (that is implemented either as an array of a link at to hold the wt of unmatched Input Format: You will be given the peace of men and women as two separate files. The second command line parter will specify the same of the file in which men's preces can be found. The third time will perify theme of the tile in which women's precbe Dos han code names of file in your program. A sample input file showing pages of for the ce of = t is shown helow. In the very first line, the set of The successivelines following it represent the perence of Man 1. Man 2 (the perfectes esperated by a space). In the following example, Man's first een 2. sed piece is Women 3 2311 2413 The format for the w's predecese ideal. Yo me that the data files are comment and don't have to check for the integrity Output Format: Your program bucatele mamelis specified as the fourth command line parameter and place the output in that fie De Dothan code filename in your program. The output should simply bean pains, one per line. A sample output is shown below. 15 Sample Command Lines Suppose your excutabile is called stable them stable boys girls matching should get the men's preferences from the files bould get the women's preferences from the file girls and should place the table matching Bound in the file matching Your Task: For this assignment you will need to implement Gale-Shapley Algorithm for finding a stable matching. For simplicity, instead of using names, we will assume that the men are numbered 1 through n and similarly, the women are numbered 1 through n. Your program should output the man-optimal stable matching produced by the Gale-Shapley Algorithm. Your implementation should be running in O(n?) time. You are expected to write the whole program (including implementation of data strucu- tures involved) yourself and not borrow any existing classes or functions from the libraries or from public domain out there. Data Structures: I want to make sure that all of you are comfortable in dealing with different data structures. Use a linked list to represent the preference lists of men. Use an array data structure to represent the preferences of women. Use a stack data structure (that is implemented either as an array or as a linked list) to hold the set of unmatched men. Input Format: You will be given the preference lists of men and women as two separate files. The second command line parameter will specify the name of the file in which men's preferences can be found. The third command line parameter will specify the name of the file in which women's preferences can be found. Do not hard code names of files in your program. A sample input file showing preferences of men for the case of n = 4 is shown below. In the very first line, the number of men is shown. The successive lines following it represent the preference of Man 1. Man 2 etc (the preferences are separated by a space). In the following example. Man 1's first preference is Women 2. second preference is Women 3 and so on. 4 2 3 1 4 4 1 2 3 3 1 4 2 2 4 1 3 The format for the women's preference file is identical. You can assume that the data files are consistent and don't have to check for their integrity. Output Format: Your program should create a file whose name is specified as the fourth command line parameter and place the output in that file. Do not hard code file names in your program. The output should simply be n man-woman pairs, one per line. A sample output is shown below. 14 2 2 31 Sample Command Lines: Suppose your executable is called "stable", then stable boys girls matching should get the men's preferences from the file "boys" and should get the women's preferences from the file "girls" and should place the stable matching found in the file "matching". General remarks: Make sure that your programs are written in C, C++ or Java and that they can run on the xlogin system (that runs SUSE Linux OS) of the department of computer science. Make sure to test your program on several test cases so that you can reasonably be confident that it is correct. While implementing, it is very easy to code certain segments of the algorithm which are not spelt in full detail in such a way that the complexity of your program becomes more than the specified complexity of the algorithms. Be extra careful to avoid such pitfalls. Objective: The objective of this site is to give you practice in implementing fairly single algorithm interite data structure Your Task: For this sciment you will do import Gale Staples Algorithm for finding a stable matching for simplicity, instead of wing us, we will see that the men are wumbered through and similarly, the numbered through 1. Yout program should output the matinal table matching produced by the Gule Shapley Algorithm. Your implementation should be in intime You are expected to write the whole program (including implementation of data struct tres involved yourself and not being of functions from the libraries or from public domain out there Data Structures. I want to make sure that all you are comfortable in line with diferent data structure the link list to post the preference lists of mente an arwy data structure to represent the prices of women are a stack data structure (that is implemented either as an array of a link at to hold the wt of unmatched Input Format: You will be given the peace of men and women as two separate files. The second command line parter will specify the same of the file in which men's preces can be found. The third time will perify theme of the tile in which women's precbe Dos han code names of file in your program. A sample input file showing pages of for the ce of = t is shown helow. In the very first line, the set of The successivelines following it represent the perence of Man 1. Man 2 (the perfectes esperated by a space). In the following example, Man's first een 2. sed piece is Women 3 2311 2413 The format for the w's predecese ideal. Yo me that the data files are comment and don't have to check for the integrity Output Format: Your program bucatele mamelis specified as the fourth command line parameter and place the output in that fie De Dothan code filename in your program. The output should simply bean pains, one per line. A sample output is shown below. 15 Sample Command Lines Suppose your excutabile is called stable them stable boys girls matching should get the men's preferences from the files bould get the women's preferences from the file girls and should place the table matching Bound in the file matching Your Task: For this assignment you will need to implement Gale-Shapley Algorithm for finding a stable matching. For simplicity, instead of using names, we will assume that the men are numbered 1 through n and similarly, the women are numbered 1 through n. Your program should output the man-optimal stable matching produced by the Gale-Shapley Algorithm. Your implementation should be running in O(n?) time. You are expected to write the whole program (including implementation of data strucu- tures involved) yourself and not borrow any existing classes or functions from the libraries or from public domain out there. Data Structures: I want to make sure that all of you are comfortable in dealing with different data structures. Use a linked list to represent the preference lists of men. Use an array data structure to represent the preferences of women. Use a stack data structure (that is implemented either as an array or as a linked list) to hold the set of unmatched men. Input Format: You will be given the preference lists of men and women as two separate files. The second command line parameter will specify the name of the file in which men's preferences can be found. The third command line parameter will specify the name of the file in which women's preferences can be found. Do not hard code names of files in your program. A sample input file showing preferences of men for the case of n = 4 is shown below. In the very first line, the number of men is shown. The successive lines following it represent the preference of Man 1. Man 2 etc (the preferences are separated by a space). In the following example. Man 1's first preference is Women 2. second preference is Women 3 and so on. 4 2 3 1 4 4 1 2 3 3 1 4 2 2 4 1 3 The format for the women's preference file is identical. You can assume that the data files are consistent and don't have to check for their integrity. Output Format: Your program should create a file whose name is specified as the fourth command line parameter and place the output in that file. Do not hard code file names in your program. The output should simply be n man-woman pairs, one per line. A sample output is shown below. 14 2 2 31 Sample Command Lines: Suppose your executable is called "stable", then stable boys girls matching should get the men's preferences from the file "boys" and should get the women's preferences from the file "girls" and should place the stable matching found in the file "matching". General remarks: Make sure that your programs are written in C, C++ or Java and that they can run on the xlogin system (that runs SUSE Linux OS) of the department of computer science. Make sure to test your program on several test cases so that you can reasonably be confident that it is correct. While implementing, it is very easy to code certain segments of the algorithm which are not spelt in full detail in such a way that the complexity of your program becomes more than the specified complexity of the algorithms. Be extra careful to avoid such pitfalls

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

Students also viewed these Databases questions

Question

Solve for x: 2(3x 1)2(x + 5) = 12

Answered: 1 week ago