Question: language needed is Java it is complete a java program that determines if a marriage is stable or not Overview: Your program will be given

Overview: Your program will be given an instance of STABLEMARRIAGE and a matching and will determine whether that matching is stable. If it is stable it will simply state that. If it is not stable it will list 1 instability. Details: The input will come from a file called input txt which will be placed in the same directory as your java file. The first line of the file will have a single integer value N which will be the number of men (or women since the number of men equals the mumber of women). The next N lines will be the whitespace separated preference lists of the N men (ie each of the next lines will be a permutation of 1, 2, ..., N). The next N lines will be the whitespace separated preference lists of the N women. The next N lines will be a whitespace separated matching. See the sample input below for examples. Your program will determine whether the matching is stable and output either Stable" or "Unstable XY" where man X prefers woman Y to his partner and woman Y prefers man X to her partner. The obvious way to way to design the program is to check every man/woman pair to determine whether it is an instability. This is acceptable. There are simple ways to speed up the process. You are encouraged to use any technique you understand. You can discuss the algorithm to be tied with anyone and consultany source (books, internet, etc). However, for this project, you are expected to write the code on your own with limited or no assistance from the professor, no assistance from others, and limited or no assistance from other sources (books, internet, etc). To clarify, you can seek assistance in understanding the task, but your code" should be written by you: not written by others, not copied from others, not copied from books/internet. Picky, but required specifications: Your project must: be submitted vin canvas. . consist of 1 or more dot-java files (no class files, zip files, input files or other files should be submitted). Each file must have your name and which project you are submitting as comments on the first 2 lines. not be placed into any package (for the java pedants, it must be in the default package). be designed and formatted reasonably correct indentation, no excessively long lines, no excessively long methods, has useful method/variable names, cte) have one file called Project 1.java: compile using the command "javac Projectljava'. run using the command 'java Project 1, accept input from a file called input.txt in the same directory as the javn file(s) formatted precisely as described above. Sample execution: If input.txt contains 3 123 2 31 3 3 3 1 2 3 21 1 3 2 213 1 2 23 31 the the output should be Stable If input.txt contains 3 1 2 3 2 31 3 1 2 3 2 1 1 3 2 213 13 21 32 the the output should be Unstable 1 2 or Unstable 2 3 Or Unstable 31 There are 3 valid outputs because there are 3 instabilities
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
