Questions
Write a program in C++ to find the number of comparisons using binarySearch and the sequential...

Write a program in C++ to find the number of comparisons using binarySearch and the sequential search algorithm as follows:

Suppose list is an array of 1000 elements.

a. Use a random number generator to fill list.

b. Use any sorting algorithm to sort list.

c. Search list for some items as follows:

i. Use the binary search algorithm to search the list. (You may need to modify the algorithm given in this chapter to count the number of comparisons.)

ii. Use the binary search algorithm to search the list, switching to a sequential search when the size of the search list reduces to less than 15. (Use the sequential search algorithm for a sorted list.)

Comments would be appreciated! Am a relatively new coder. Thank you.

In: Computer Science

List the components of blood?

List the components of blood?

In: Anatomy and Physiology

list of vehicles and their horsepower. These are:

 

list of vehicles and their horsepower. These are:

211    230    182    155   320   310   320   140

177    138    306    310   171   169   150

a) Find the mean and standard deviation of the horsepower data.

b) Draw a normal probability plot (QQ plot) for the horsepower data

c) Draw a histogram of the horsepower data.

d) Using the actual data, find the number of cars with horsepower higher than the first car listed (211 hp). Then divide by 15 to get a percent

e) Using normalcdf, find the percent of cars with more horsepower than the first car listed (211 hp).

f) Compare your results of parts d and e. Are they close?

g) Do the data appear normal? Explain using parts b ,e and f

please answer only e, f, and g questions  !! thanks

here is A to D answers

Answers B

A) If the observations are

X1,X2,X3,X4,X5…………X15

Mean= 219.3

Std=72.9

B) A normal probability plot is created using Minitab

C) The Histogram of the horsepower data is created using Minitab

X represent horsepower

D) Number of cars with horsepower higher than first car listed(2011hp)=6

Percent=6/15*100=40%

In: Statistics and Probability

List types of inflation

List types of inflation

In: Economics

List of nursing regulations.

List of nursing regulations.

In: Nursing

List the characteristic of journal

List the characteristic of journal

In: Accounting

List the investment process ?

List the investment process ?

In: Finance

List the steps of Glycolysis

List the steps of Glycolysis

In: Anatomy and Physiology

list igneous rock

list igneous rock

In: Civil Engineering

LISP FUNCTIONS Imagine you are writing the AI for a simple game that will require an...

LISP FUNCTIONS

Imagine you are writing the AI for a simple game that will require an adversarial search.

The state of the game can be represented using a list of 3 elements, such as (B B B). The list representing the game state can contain any combination of 3 values: A, B, or C. It will always have exactly 3 items. (Let's call it the "state list").

With that in mind, write the following LISP functions:

  • TERMINAL-TEST - this function takes a state list as it's only argument. If the list contains no B's, it is considered a terminal state and TERMINAL-TEST should return t, nil otherwise.
  • UTILITY - this function accepts a state list as it's only argument and evaluates the state list. If the list contains all A's, then the function returns 1. If the list contains all C's, then the function returns -1. Any other combination of A's, B's, or C's returns 0.
  • ACTIONS - this function accepts a state list as it's only argument and returns a list of possible actions according to the following table:
    State Action
    (B * *) A1
    (* B *) A2
    ( * * B) A3

    Where :
    * represents A, B, or C
    State is the state list passed to the function
    Action is the possible action returned given that state

    So, if the state list passed to the function was (B C B), then the function should return (A1 A3).
  • RESULT - this function accepts a state list and an action as it's only arguments. The function then returns a state list according to the following table:
    State Action Returned
    (B * *) A1 (A * *)
    (* B *) A2 (* A *)
    (* * B) A3 (* * A)
    Where:

    State and Action are both passed as arguments and
    Returned is the state list that is returned.
    The * represents A, B, or C.

    For example, if (B C B) and A3 were both passed as arguments, then the state list that gets returned would be (B C A).

Demonstrate your functions work by calling each one in turn, passing each of them appropriate arguments, and then printing to the screen the values they returned.

In: Computer Science