Reference no: EM131398385
Question 1.
Let a[0..n-1] be an array of n distinct integers. A pair (a[i], a[j]) is said to be an inversion if these numbers are out of order, i.e., i<j but a[i] > a[j].
For example: if array a contains the following numbers:
9, 8, 4, 5
then the number of inversions is 5.
(inversions are 9 > 8, 9 > 4, 9 > 5, 8 > 4, 8 > 5)
Write a program that uses the divide-and-conquer techniqueto count the number of inversion in the array.
Question 2. Given two sets of nunique integers A and B, determine if A is equal to B, i.e., all the elements of A are in B.Write a program that uses a transform-and-conqueralgorithm with efficiency class Θ(nlogn) to solve this problem.
Example #1: Enter the number of integers in the sets: 4
Enter the first set: 9 5 3 2
Enter the second set: 3 2 9 5
These two sets are equal.
Example #2: Enter the number of integers in the sets: 6
Enter the first set: 1 4 3 2 8 6
Enter the second set: 1 3 9 4 6 8
These two sets are not equal.
Please note that a program using a brute-force algorithm with efficiency class Θ(n2) will NOT be marked.
Task environment of a retail clothing store
: 1. Analyse the major forces in the task environment of a retail clothing store. 2. Devise a program that will help other managers and employees to better understand and respond to their store's task environment.
|
Propose a solution that will relieve friction in company age
: Imagine that you work for a company with an age diverse workforce. You have baby boomers working with millenials. Their backgrounds are different, and how they view work is different. This is causing some friction within the workforce. Before the ..
|
Which countries can profit from ibm’s liebert sitescan
: How are companies adopting solar power? Write a report summarizing your findings, and include a table of links to Web sites that provide additional details.
|
Discussion-organizational factors
: Analyze and evaluate how organizational factors within an aviation operational organization (flight, maintenance, air traffic control, and airport) can have both positive and negative influences on safety within that organization. Discuss what tho..
|
Write a program that uses the divide-and-conquer technique
: Write a program that uses the divide-and-conquer technique to count the number of inversion in the array - using a brute-force algorithm with efficiency class Θ(n2) will NOT be marked.
|
What was the issue in the case and what was courts ruling
: What was the issue in the case and what was the court's ruling? Do you agree or disagree? Why? Be sure you provide a link to the case.
|
How considering objections help you clarify your perspective
: Finally, consider the argument you have been developing for your writing assignments. How has considering objections helped you clarify your perspective
|
Standards of practice related to competency
: What are some issues affecting standards of practice related to competency of medical care within rural hospitals? Can you please direct me to a few scholarly articles that defines and talks about such issues? Please do not include the Lyckholm an..
|
What values for c should you use in given equation
: If you want to compute a .80, .92, or .98 confidence interval for µ when σ is known, and sampling is from a normal distribution, what values for c should you use in given Equation?
|