Select Page

# I was told to rewrite the algorithm below to a standard algorithm. I am not sure if I need an exit statement or

I was told to rewrite the algorithm below to a standard algorithm. I am not sure if I need an exit statement or not.Here is my algorithm and the image down below is the algorithm that I needed to rewrite:Function location (S, n, x, low, high)// S is an integer type that represented the sorted (nondecreasing order) input array of n integers //// n is an integer type that represented the input size of an array //// x is an integer type that represented the input key value ////low is an integer type that represented the minimum value in the array ////high is an integer type represented the maximum value in the array //Integer S (1 : n), n, x, low, high, mid, index// index is an integer type represented the return value //if (low > high) then              index ? 0else              mid = (low + high) / 2              if (x = S[mid]) then                        index ? mid              else                       if (x < S[mid]) then                               ndex ? location (low, mid - 1)              else                             index ? location (mid + 1, high)              return (index)              exit #### Do I need the exit here or just take it off? ####end locationAlgorithm 2.1Binary Search (Recursive)Problem: Determine whether x is in the sorted array S of size n.Inputs: positive integer n, sorted (nondecreasing order) array of keys S indexedfrom 1 to n, a key x.Outputs: location, the location of x in S (0 if x is not in S).index location (index low, index high)index mid;if ( low > high )return 0;else {mid = [( low + high )/2] ;if (x == S[mid])return midelse if (x < S[mid])return location (low, mid - 1);elsereturn location (mid + 1, high );

Give us your instructions.
Select the type of service you need: writing, calculations, or programming. We’ve created an intuitive order form that tells you what information to enter and where, so make sure to fill out each required field. Also, make your requirements as specific as possible. Don’t rush! Take your time and explain everything in detail how it works.

Proceed to checkout and enter your credit card details or PayPal login, how to pay. Follow the payment provider’s instructions to confirm the transaction.
Now your order is in our system! We’ll start processing it right away.

## Place Your Order

##### Frequently asked questions

When you place an order with our company, we ask you to provide us with such personal information as your name, phone number, and email address. We need this data to keep you updated on the important things related to your order or account.

##### Is there a possibility of plagiarism in my completed order?

We complete each paper from scratch and in order to make you feel safe regarding its authenticity, we check it for plagiarism before its delivery. To do that, we use our in-house software, which can find not only copy-pasted fragments but even paraphrased pieces of text. Unlike popular plagiarism detection systems that are used by most universities (e.g. Turnitin.com), we do not report to any public databases—therefore, such checking is safe.

We provide a plagiarism-free guarantee that ensures your paper is always checked for its uniqueness.

##### Is there a money-back guarantee? If yes, how can I receive a refund?

You can certainly get your money back in several cases. You can receive a full refund if you have paid for your order twice or if you have placed two identical orders. In case your paper was late or the quality of the paper does not correspond to your expectations, you will get compensation for these issues.

##### Do you keep a database of pre-written essays?

No, we do not have such a database. All papers you order from us are written from scratch. This means your paper is unique and has never been published before—neither will it be published after we deliver it to you.

##### When will my custom paper be done?

While placing an order with WritersHub, you can choose a period of time within which a paper should be delivered to you. The countdown until the specified deadline starts automatically from the moment we receive your payment in our system. For example, if you pay for your order at 6pm on Monday and choose a 3-day delivery option, you will receive your custom paper by 6pm on Thursday.

Remember that a writer needs a sufficient amount of time in order to conduct thorough research. Therefore, please choose the most suitable deadline when you place an order. Moreover, the later you need your paper to be delivered to you, the cheaper it will be. Thus, you will be able to save your money while your writer will have enough time to work on your order and ensure its quality.

Make sure you upload all the additional materials at the very beginning. If you fail to do that, the deadline for your order will be postponed as well.