Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem1 Assume you are given an array-like data structure, E, such that E is arbitrarily large and there is no way to know the

image

Problem1 Assume you are given an array-like data structure, E, such that E is arbitrarily large and there is no way to know the size of it. The array E is populated with integer values, from the beginning up to the nth cell, sorted in increasing order. The rest of the cells after the nth contain a very large integer call it max and you don't know n. Your goal is to describe an algorithm that receives an integer value x (x < max) and returns the position of that integer in E in O(log n). You can assume that x exists in E Problem2 The AA department has received several applications for teaching assisteacher Assisnt po sitions from its students. The applicants are provided with the list of available courses and asked to submit a list of their preferences. The teacher Assis committee at UNIV prepares a sorted list of the applicants (according to the applicants' background and experience) for each course and the toteacher Assisl number of teacher Assiss needed for the course. Note that there are more students than available teacher Assis spots. There can also be multiple teacher Assiss per course, though a single teacher Assis can only be assigned to 1 course. Making matter more complicated, certeacher Assisin applicant-course are disallowed since an applicant does not have enough background in a specific course. We will say that A (an applicant) prefers C (a course) to C ' iff C is ranked higher than C' on his/her preference list. The committee wants to apply an algorithm to produce steacher Assisble assignments such that each student is assigned to at most one course. The assignment of the teacher Assiss to courses is steacher Assisble if none of the following situations arises. 1. If an applicant A and a course C are allowed and not matched, but A prefers C more than his/her assigned course, and C prefers A more than, at least, one of the applicants assigned to it. 2. If an applicant, A, and a course, C, are allowed such that A is unmatched, and C has an empty spot or an applicant A' assigned to it such that C prefers A to A' . You need slove these problems: 1.Modify the Gale-Shapley algorithm to find a steacher Assisble assignment for the teacher Assiss-Courses matching problem. Write pseudo code of modified algorithm. 2.Prove that the modified algorithm produces steacher Assisble teacher Assiss-Courses assign ments.

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_2

Step: 3

blur-text-image_3

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

Intermediate Accounting IFRS

Authors: Donald E. Kieso, Jerry J. Weygandt, Terry D. Warfield

3rd edition

1119372933, 978-1119372936

More Books

Students also viewed these Algorithms questions