2. Let BT Node be the class we often use for binary-tree nodes. Write the following recursive methods: (a) numLeaves: a method that takes a BT Node T as parameter and returns the number of leaves in the tree rooted at T. (b) isEven: a boolean method that takes a BT Node T and checks whether its tree is strictly binary: every node in the tree has an even number of children.
3. Suppose you want to improve Merge Sort by first applying Heap Sort to a number of consecutive subarrays. Given an array A, your algorithm subdivides A into subarrays A1, A2 · · · Ak, where k is some power of 2, and applies Heap Sort on each subarray Ai alone. The algorithm proceeds into merging pairs of consecutive subarrays until the array is sorted. For example, if k = 4, you first apply Heap Sort to sort each Ai and then you merge A1 with A2 and A3 with A4, then you apply the merge function once to get the sorted array. (a) Does the proposed algorithm improve the asymptotic running time of Merge Sort when k = 2? How about the case k = log n (or a power of 2 that is closest to log n)? Justify. (b) Is the proposed algorithm stable? Is it in-place? Prove your answers.
4. Write a clear pseudocode for Breadth-First Search (BFS) in undirected graphs. How would you modify your code to compute the number of connected components in the input graph? Give details about the used data structures and the running time.
5. Write a clear pseudocode for Depth-First Search (DFS) in graphs. How would you modify your code to check whether the graph is acyclic?
6. The centrality of a vertex v in an undirected graph G is measured as follows: c(v) = n1(v) + n2(v) + · · · nd(v) where ni(v) is the number of vertices at distance i from v (e.g., n1(v) is the number of neighbors of v) and d is the maximum distance between v and a vertex of the same connected component as v in G (so d = 0 if v is isolated). Write the pseudocode of a most-efficient algorithm that computes the centrality of a vertex v in a given graph G. What is the running time of your algorithm? Prove your answer.
In: Computer Science

An infinitely long solid insulating cylinder of radius a = 5.6 cm is positioned with its symmetry axis along the z-axis as shown. The cylinder is uniformly charged with a charge density ρ = 25 μC/m3. Concentric with the cylinder is a cylindrical conducting shell of inner radius b = 14.5 cm, and outer radius c = 17.5 cm. The conducting shell has a linear charge density λ = -0.41μC/m.
1. What is V(P) – V(R), the potential difference between points P and R? Point P is located at (x,y) = (42 cm, 42 cm).
2. What is V(c) - V(a), the potentital difference between the outer surface of the conductor and the outer surface of the insulator?
3. Defining the zero of potential to be along the z-axis (x = y = 0), what is the sign of the potential at the surface of the insulator? V(a) < 0 V(a) = 0 V(a) > 0
4. The charge density of the insulating cylinder is now changed to a new value, ρ’ and it is found that the electric field at point P is now zero. What is the value of ρ’?
In: Physics
Ms. V, a wealthy art collector in Country W, is interested in buying a rare painting from Mr. Y in Country Z. Both parties agree that the price is to be determined by an independent appraiser. V informs Y that she will send her agent, X, with a check to collect the painting. V draws a check payable to Y but leaves the amount blank. She gives the check to X and instructs him to deliver it to Y. Without authority, X fills in the amount for $1 million and presents it to Y, who has, in the meantime, received the appraisal. The appraised price is $750,000. X tells Y that Ms. V had made the check out for $1 million to ensure that it will exceed the appraisal price, and that V has instructed X to return with the painting and the difference in cash. Y gives X the painting and $250,000. X delivers the painting but then disappears with the $250,000 in cash. When V discovers what has happened, she stops payment on her check and offers to pay Y $750,000 for the painting. Y insists that V must pay the check's full face value of $1 million. Is Y correct? Why or why not?
In: Economics
7) Suppose that you select 2 cards without replacement from a standard deck of 52 playing cards.
a) If the first card that you select is not a heart, what is the probability that the second card that you select is a heart?
b) If the first card that you select is a six, what is the probability that the second card that you select is a diamond?
8) Suppose that a teacher is going to assign a book report to her class of 22 students. Each student must select one book from an approved reading list and once a book is selected by a student, no other student may select the same book. The reading list consists of a total of 39 books of which 15 are considered classic fiction and the other 24 are considered modern fiction. Assuming that the order in which the books are selected doesn’t matter:
a) In how many ways can the books be selected so that all of the classic fiction books are picked?
b) In how many ways can the books be assigned so that there is at least one classic fiction book that is not picked and at least one modern fiction book that is not picked.
In: Statistics and Probability
In a study of memory recall, eight students from a large psychology class were selected at random and given 10 minutes to memorize a list of 20 nonsense words. Each was asked to list as many of the words as he or she could remember both 1 hour and 24 hours later. The data are as shown in the accompanying table. Use these data to estimate the difference in mean number of words remembered after 1 hour and after 24 hours. Build and interpret a 90% confidence interval. It is safe to assume an approximate normal distribution.
1 Hour: 14 12 18 7 11 9 16 15
24 Hrs: 10 4 14 6 9 6 12 12
#1. all Hypothesis Tests must include all four steps, clearly labeled;
#2. all Confidence Intervals must include all output as well as the CI itself
#3. include which calculator function you used for each problem.
Anyone that could help answer this I would greatly appreciate it with an explanation please! Thanks!
In: Statistics and Probability
Identify which of these types of sampling is used: Convenience, Random (SRS), Systematic, Stratified, or Cluster sampling.
A Los Angeles Times reporter gets a reaction to a breaking story by poling people as they pass the front of the Times building.
The Orange County Commissioner of Jurors obtains a list of 55,014 car owners and constructs a poll of jurors by selecting every 50th name on the list.
In a Harris poll of 1,011 adults, the interview subjects were selected by using a computer to randomly generate telephone numbers that were then called.
A Ford Motor Company researcher has partitioned all registered cars into categories of compact, mid-size, and family-size. He is surveying 75 car owners from each category.
Motivated by a student who died from binge drinking, Chico State conducts a study of student drinking by randomly selecting 10 different classes and interviewing all of the students in each of those classes.
A statistics student obtains height/weight data by interviewing the members of his fraternity.
A UCLA researcher surveys all cardiac patients in each of 30 randomly selected hospitals.
In: Statistics and Probability
ASU is concerned about the retention rate among its students, i.e. percentage of ASU students that return next semester.To do this, ASU randomly selects 200 students and records whether or not they return to ASU the following semester. What is the statistic?
| a. |
The percentage of the 200 students that returned. |
|
| b. |
All ASU students. |
|
| c. |
The percentage of all ASU students that returned. |
|
| d. |
The 200 ASU students that were selected. |
In: Statistics and Probability
Derive the following statement
"T(temperatue)-V(volume) and P(pressure)-V(volume) relationship in the adiabatic changes"
In: Chemistry
Prepare a comprehensive and thumbnail brief of each of the following opinions:
United States v. Kovel
Brown v. Hammond
In: Operations Management
[system of linear Differential Equations] Use matrix methods to solve the follow initial -value problem,
u (t) = 2u (t) + 2v (t) + 4
V (t) = u (t) + 3v (t) – 1
u (0) = 2
v (0) = -1
[ find, u (t) and v (t) ].
In: Math