Construct a permutation of the ten distinct elements (i.e. the digits 0,1,2,3,4,5,6,7,8,9) that is as bad as possible for quicksort using median-of-three partitioning. Please write out what the permutation is and describe how you found what it is.
In: Computer Science
How many iterations of the for loop does this program perform?
int main(void) {
int a[] = {1, 2, 3, 4};
int i;
for (i = 0; i < 4; i++) {
if (a[i] < 0) return 1;
else return 0;
}
return 0;
}
Question 1 options:
| A |
No iterations. |
| B |
The program crashes. |
| C |
One. |
| D |
The program does not compile. |
| E |
Four. |
Question 2
What does the following program do?
int main(void) {
int i, a[];
a[0]=1;
for (i=0; i<10; i++) {
a[i] = a[i-1] + 2*i + 1;
}
return 0;
}
Question 2 options:
| A |
It crashes when it is run because no memory is reserved for the array. |
| B |
It does not compile. |
| C |
It fills the array with the squares of the integers from 1 to 10. |
| D |
It fills the array with the first 10 powers of 2. |
Question 3
What's the problem with this code?
int main(void) {
int i, a[5];
for (i=1; i <= 5; i++) {
a[i] = i+1;
}
return 0;
}
Question 3 options:
| A |
The main problem is that the loop accesses a non-existing a[5]. This will cause some memory location to be inadvertently written. The secondary problem is that a[0] is left uninitialized. |
| B |
It doesn't compile because one cannot declare an int variable and an int array on the same line. |
| C |
There is no problem. The code will run just fine. |
| D |
It crashes because a[1] is accessed before a[0]. |
Question 4
If a is declared with
int a[10];
what value does sizeof(a) have?
Question 4 options:
| A |
14 |
| B |
Whatever is the size of a pointer to an integer. |
| C |
10 |
| D |
10*sizeof(int) |
Question 5
What does the following program do?
#include
int main(void) {
int a[] = {1,2,3,4};
int b[4]; b = a;
printf("%4d\n", b);
return 0;
}
Question 5 options:
| A |
It prints 1 2 3 4. |
| B |
The program incurs a segmentation fault when run. |
| C |
It does not compile. You cannot copy arrays like that. |
| D |
It does not compile. You cannot print an entire array like that. |
question 6
Arrays are just pointers in disguise.
Question 6 options:
| A | True |
| B | False |
Question 7
Declaring too large an array in a function may cause a stack overflow when the function is called.
Question 7 options:
| A | True |
| B | False |
Question 8
What does the following program do?
int main(void) {
int a[4];
a = {1,2,3,4};
return a[3];
}
Question 8 options:
| A |
It crashes because main can only return 0. |
| B |
It returns 3. |
| C |
It returns 4. |
| D |
It does not compile. |
Question 9
What does the following program do?
#include
int main(void) {
int i = 2;
int a[] = {0,1,2,3,4};
int n = sizeof(a) / sizeof(a[0]);
for (i = 0; i < n; i++) {
(*(a+i))++;
printf(" %d", a[i]);
}
printf("\n");
return 0;
}
Question 9 options:
| A |
It does not compile. |
| B |
It prints: 1 1 1 1 1 |
| C |
Prints: 1 2 3 4 5. |
| D |
It crashes because it causes a segmentation fault. |
Question 10
What does the following program do?
#include
int main(void) {
int * p;
int a[] = {0,1,2,3,4};
int n = sizeof(a) / sizeof(a[0]);
for (p = a; p != a+n; p++) {
printf(" %d", *p);
}
printf("\n");
return 0;
}
Question 10 options:
| A |
It crashes because p != a+n accesses an address that isout of bounds. |
| B |
It doesn't compile. You cannot assign an array to a pointer because they are of different types. |
| C |
It prints nonsense because %d is for integers, while p is a pointer. |
| D |
It prints: 0 1 2 3 4 |
In: Computer Science
Knott's Industries manufactures standard and super premium backyard swing sets. Currently it has four identical swing-set-making machines, which are operated 250250 days per year and 8 hours each day. A capacity cushion of 1515 percent is desired. The following information is also known:
Standard Model Super Premium Model
Annual Demand: 20,000 10,000
Standard Processing Time: 5 min 17 min
Average Lot Size: 60 25
Standard Setup Time per Lot: 30 min 45 min
a. Does Knott's have sufficient capacity to meet annual demand?
b. How many machines are needed?
In: Finance
C language <stdio.h> (functions)
Write a program to display a table of Fahrenheit temperatures and their equivalent Celsius temperatures. Create a function to do the conversion from Fahrenheit to Celsius. Invoke the function from within a for loop in main() to display the table. Ask the user for a starting temperature and and ending temperature. Validate that the starting temperature is within the range of -100 to 300 degrees, Validate that the ending temperature is in the range of -100 to 300 degrees, and is also greater than the starting temperature. Use a decision inside the ending temperature validation loop to display either the "out-of-range" message or the "greater than starting temperature" message.
The formula for converting a Fahrenheit temperature to Celsius
is:
C = (5 / 9) * (F - 32)
Use this exact formula - do not pre-calculate 5/9 as .56 (you will
have to type cast one of the numbers to a double for the equation
to work correctly).
Format the Celsius temperatures to 1 decimal place.
Example Run #1:
(bold type is what is entered by the user)
Enter a starting Fahrenheit temperature:
-200
The starting temperature must be between -100 and 300
degrees.
Please re-enter the starting temperature: 0
Enter an ending Fahrenheit temperature: 500
The ending temperature must be between -100 and 300 degrees.
Please re-enter the ending temperature: -20
The ending temperature, -20, must be greater than the starting
temperature.
Please re-enter the ending temperature: 20
Fahrenheit Celsius
0 xx.x
1 xx.x
2 xx.x
3 xx.x
4 xx.x
5 xx.x
6 xx.x
7 xx.x
8 xx.x
9 xx.x
10 xx.x
11 xx.x
12 xx.x
13 xx.x
14 xx.x
15 xx.x
16 xx.x
17 xx.x
18 xx.x
19 xx.x
20 xx.x
The example run shows EXACTLY how your program input and output will look.
In: Computer Science
What is the pH of a 2.75 x 10-3 M solution of potassium fluoride, KF, in water? The Ka for hydrofluoric acid is 3.55 x 10-5.
please show steps!!
the answer is 7.94
In: Chemistry
Create a command based menu using functions.
The structure should be as followed:
In: Computer Science
What is the cobalt (II) ion concentration in a solution prepared by mixing 431 mL of 0.444 M cobalt (II) nitrate with 419 mL of 0.276 M sodium hydroxide? The Ksp of cobalt (II) hydroxide is 1.3 × 10-15
In: Chemistry
the national collegiate athletic association requires colleges to report the graduation rates of their athletes. at one large university, 78% of all students who entered in 2004 graduated in six years. one hundred thirty seven of the 190 students who entered with athletic scholarship graduated . consider these 190 as a sample of all athletes who will be admitted under present policies. is there evidence at the 5% level that the the percentage of athletes who graduate is less than 78%?
1. List the conditions for the test you plan to use, explain how these conditions are met, calculate and write down the test statistic, and find the P-value.
2. based on your P-value, conclude in context
In: Math
Answer all of these following questions below with a total response that should be 300-500 words.
The following questions should be answered about the : Amygdala
In: Anatomy and Physiology
Below is a list of vocabularies, concepts, theories, and terms please answer all of them briefly.
UCC 2
Magnuson – Moss Warranty Act
Mortgage
Deed
Warranty of merchantability
Bailment
Statute of Frauds
Mitigation
Title
Novation
Assignment
Delegation
Personal Service Contract
Condition Precedent
Condition Subsequent
Substantial Performance
Waiver
Restitution
Unconscionability
Eviction
Policy
Lease
Deductible
Deficiency judgment
Liquidated damages
Unilateral contract
Bi-lateral contract
Offer
Acceptance
Consideration
Objective theory of contracts
Revocation
Counteroffer
Capacity
Legality
Ratification
Usury
Appraisal
Pledge
Undue influence
Holdover proceeding
Nonpayment proceeding
Petitioner
Respondent
Anticipatory repudiation
Statute of limitations
Statute of repose
Bankruptcy
Chapter 7
Chapter 11
Automatic stay
Garnishment
Exempt property
License
Policy
Premium
Testator
Administrator
Executor
In: Accounting
Acrylic bone cement is commonly used in total joint replacement to secure the artificial joint. Data on the force (measured in Newtons, N) required to break a cement bond was determined under two different temperature conditions and in two different mediums appear in the following table. Temperature Medium Data on Breaking Force 22 degrees Dry 100.6, 142.9, 194.8, 118.4, 176.1, 213.1 37 degrees Dry 303.3, 338.3, 288.8, 306.8, 305.2, 327.5 22 degrees Wet 386.4, 368.2, 322.6, 307.4, 357.9, 321.4 37 degrees Wet 363.6, 376.8, 327.7, 331.9, 338.1, 394.6 (a) Estimate the difference between the mean breaking force in a dry medium at 37 degrees and the mean breaking force at the same temperature in a wet medium using a 90% confidence interval. (Round your answers to one decimal place.) ( , ) (b) Is there sufficient evidence to conclude that the mean breaking force in a dry medium at the higher temperature is greater than the mean breaking force at the lower temperature by more than 100 N? Test the relevant hypotheses using a significance level of 0.10. (Use μhigher temperature − μlower temperature. Round your test statistic to two decimal places. Round your degrees of freedom to the nearest whole number. Round your p-value to three decimal places.) t = df = P =
In: Math
1.) A.) CTP stablizes the R or T state? (pick one) of aspartate carbamoyl transferase (ACTase) and acts as a:
a.) positive regulator b.) negative regulator c.) a co-factor d.) competitive inhibitor
B.) regulation of ACTase results in equal numbers of synthesized purines and pyrimidines. explain how this occurs.
C.) What would be the shape of the michaelis-menten curve for this enzyme (like parabolic, sigmoidal,etc)?
In: Chemistry
Geographic segmentation: Geographic segmentation is done based on variables like city, country, or region. In the case of Kathmandu, we will select the city or places which are tourist destinations and also host adventure sports.
Demographic segmentation: Demographic segmentation is used to divide the market on the basis of demographic variables like age, gender, ethnicity, etc. we will select Age variable for Kathmandu as the product is mainly used by people of certain age groups.
Psychographic segmentation: Psychographic segmentation is a technique to segment the market in different segments based on psychographic variables like values, interest, or attitude. For Kathmandu, we will select the interest as a variable under psychographic segmentation. Because the interest in travel and adventure sports is a must in the segment for Kathmandu products.
Behavioral segmentation: This technique of market segmentation is based on behavioral variables like purchase behavior. brand loyalty, usage pattern, benefits sought, etc. For Kathmandu, we will select benefits sought as a variable under behavioral segmentation. Benefits sought from travel and adventure products will be considered as segmentation variables for Kathmandu's product because there is certain type of expectation customer has from travel and adventure products.
Question: According to the four variables above, choose a target segment in Australia for Kathmandu. You can use one variable or combine some variables to determine the target segment. Analyze this target segment by applying the five effective segmentation criteria (Measurable, Substantial, Accessible, Differentiable, and Actionable).
In: Operations Management
Cation Group III Quantitative Analysis Lab?
We just completed our unknown lab, where we are given a test tube with some of the Group III cations (Zn, Cr, Mn, Fe, Al, Ni, Co, and we dont know which are present) and we need to write a discussion about certain chemical concepts, and I am stuck on some.
http://web.cerritos.edu/cshimazu/SitePages/Chem%20112/112%20Experiments/5%20Cation%20III%20Part%20B/Cation%20III%20Part%20B.pdf
(That is the lab handout in case I don't make sense)
So we need to write about equilibrium, and explain it using Le Chatalier's principle and give examples
We can talk about complex ions, like why do some form complex ions and others do not?
Whey do cation III group ions form a hydroxide precipitate in the first place?
Discuss buffers. The buffers we used were NaBiO3, we used it when the solution was acidic , how do they work and why are they important?
In: Chemistry
Please convert the following machine code (given in Hex format) into assembly code and next, b) provide the semantics of each instruction using RTL
i) 0x8FA80004
ii) 0x12110005
iii) 0x02429820
iv) ox081000A9
v) 0C0000FA
In: Computer Science