# Use the binary balancing algorithm here:

Want create site? Find Free WordPress Themes and plugins.

Use the binary balancing algorithm here:

#include <iostream>#include <iomanip>#include <cstdlib>#include <cmath>using namespace std;

void FindMiddle(int x, int y, int level, int nr,   int round){ int mid;  if (abs(x-y)<2)  { if (x==1)   cout << level << ” ” << setw(2) << x << endl;  if (y==nr)   cout << level << ” ” << setw(2) << y << endl;  return;  }  if ((y+x)%2)  { mid=(x+y+round)/2;  cout << level << ” ” << setw(2) << mid << endl;  } else  { mid = (x+y)/2;  cout << level << ” ” << setw(2) << mid << endl;  }  FindMiddle(x,mid,(level+1),nr,-1); // round down left  FindMiddle(mid,y,(level+1),nr,1);  // round up right  return;}

int main(){ int nr, level=0;  cout << “Enter integer number of elements: “;  if (cin >> nr)  if (nr>2)  FindMiddle(1,nr,(level+1),nr,1);  return 0;}

I want a program given a data set of these names: William, Ben, Edward, Kevin, Greer, Tim, Nate, John, Raziel, Rongjuan, Ofer, Steve, Ian, Tom.  The program must construct a binary tree which is as balanced as possible. There are 14 names in this list, it is one name short of the count which is required to produce a perfectly balanced binary tree structure which contains four levels. Nevertheless, the program must create a tree which contains these names and which is as balanced as possible by using the code above.

Here is an outline of what the program must do:

(1)  Enter the unsorted list of names into an array and sort this list in the array.  Be sure to retain the count of array elements.  For this problem you may use static arrays which are large enough to handle the sample test data given above.

(2)  Use the count of array elements and the findMiddle algorithm to rearrange the sorted array into a second array which contains the middle element in the first position, the elements in the first quarter and third quarter positions in the second and third positions, the elements in the first, third, fifth and seven-eighths positions into the fourth through seventh positions, etc.

(3)  Move each of the elements of the second array in succession into a binary tree structure.

(4)  Display the balanced tree using one of the available binary tree display algorithms.

Please copy and paste your source code directly to me and screen shot the output.

# Our Service Charter

1. ### Excellent Quality / 100% Plagiarism-Free

We employ a number of measures to ensure top quality essays. The papers go through a system of quality control prior to delivery. We run plagiarism checks on each paper to ensure that they will be 100% plagiarism-free. So, only clean copies hit customers’ emails. We also never resell the papers completed by our writers. So, once it is checked using a plagiarism checker, the paper will be unique. Speaking of the academic writing standards, we will stick to the assignment brief given by the customer and assign the perfect writer. By saying “the perfect writer” we mean the one having an academic degree in the customer’s study field and positive feedback from other customers.
2. ### Free Revisions

We keep the quality bar of all papers high. But in case you need some extra brilliance to the paper, here’s what to do. First of all, you can choose a top writer. It means that we will assign an expert with a degree in your subject. And secondly, you can rely on our editing services. Our editors will revise your papers, checking whether or not they comply with high standards of academic writing. In addition, editing entails adjusting content if it’s off the topic, adding more sources, refining the language style, and making sure the referencing style is followed.
3. ### Confidentiality / 100% No Disclosure

We make sure that clients’ personal data remains confidential and is not exploited for any purposes beyond those related to our services. We only ask you to provide us with the information that is required to produce the paper according to your writing needs. Please note that the payment info is protected as well. Feel free to refer to the support team for more information about our payment methods. The fact that you used our service is kept secret due to the advanced security standards. So, you can be sure that no one will find out that you got a paper from our writing service.
4. ### Money Back Guarantee

If the writer doesn’t address all the questions on your assignment brief or the delivered paper appears to be off the topic, you can ask for a refund. Or, if it is applicable, you can opt in for free revision within 14-30 days, depending on your paper’s length. The revision or refund request should be sent within 14 days after delivery. The customer gets 100% money-back in case they haven't downloaded the paper. All approved refunds will be returned to the customer’s credit card or Bonus Balance in a form of store credit. Take a note that we will send an extra compensation if the customers goes with a store credit.

We have a support team working 24/7 ready to give your issue concerning the order their immediate attention. If you have any questions about the ordering process, communication with the writer, payment options, feel free to join live chat. Be sure to get a fast response. They can also give you the exact price quote, taking into account the timing, desired academic level of the paper, and the number of pages.

Excellent Quality
Zero Plagiarism
Expert Writers

or
Did you find apk for android? You can find new Free Android Games and apps.