How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask Ingo U Your Own Question

Ingo U
Ingo U, Software Engineer
Category: Homework
Satisfied Customers: 489
Experience:  Over 25 years experience in software development. Expert in Microsoft .Net, C#, C++, VB, SQL
44076068
Type Your Homework Question Here...
Ingo U is online now
A new question is answered every 9 seconds

C++ QuestionBucket sort program.This file must contain

Resolved Question:

C++ Question

Bucket sort program.

This file must contain the following:
Entire C++ directory structure tree
A fully tested and appropriately commented program

(Bucket Sort) A bucket sort begins with a one-dimensional array of positive integers to be sorted and a two-dimensional array of integers with rows subscripted from 0 to 9 and columns subscripted from 0 to n - 1, where n is the number of values in the array to be sorted. Each row of the two-dimensional array is referred to as a bucket. Write a method bucketSort that takes an integer array as an argument and performs as follows:

Place each value of the one-dimensional array into a row of the bucket array based on the value’s ones digit. For example, 97 is placed in row 7, 3 is placed in row 3 and 100 is placed in row 0. This is called a "distribution pass."

Loop through the bucket array row by row and copy the values back to the original array. This is called a "gathering pass." The new order of the preceding values in the single- subscripted array is 100, 3 and 97.

Repeat this process for each subsequent digit position (tens, hundreds, thousands, etc.).
On the second pass, 100 is placed in row 0, 3 is placed in row 0 (because 3 has no tens digit) and 97 is placed in row 9. After the gathering pass, the order of the values in the one-dimensional array is 100, 3 and 97. On the third pass, 100 is placed in row 1, 3 is placed in row 0 and 97 is placed in row 0 (after the 3). After the last gathering pass, the original array is now in sorted order.

Note that the two-dimensional array of buckets is ten times the size of the integer array being sorted. This sorting technique provides better performance than a bubble sort, but requires much more memory. The bubble sort requires space for only one additional element of data. This is an example of the space-time trade-off: The bucket sort uses more memory than the bubble sort, but performs better. This version of the bucket sort requires copying all the data back to the original array on each pass. Another possibility is to create a second two-dimensional bucket array and repeatedly swap the data between the two bucket arrays.

Additional Requirements:

The BucketSort function should be implemented in a separate .cpp file from the main program with the function prototype specified in a .h file with the same name.

The main program should contin, in addition to the main program, and initialization function that will take an array and the array length as input parameters and initialize it to contain randomly generated numbers between 0 and 10,000.

The main program should:

a) declare and initialize an array of 16 integers (using the initialization function described above)
b) print out the contents of the array
c) call the sort function
d) print out the contents of the sorted array

I really need good comments to understand what's going on. Thank you!
Submitted: 1 year ago.
Category: Homework
Expert:  Josie-Mod replied 1 year ago.
Hi, I'm a Moderator for this topic. I've been working hard to find a professional to assist you right away, but sometimes finding the right professional can take a little longer than expected.


I wonder whether you're ok with continuing to wait for an answer. If you are, please let me know and I will continue my search. If not, please let me know and I will cancel this question for you. Thank you!
Customer: replied 1 year ago.
I would like to continue the search.
Expert:  Josie-Mod replied 1 year ago.
Thank you for your continued patience. We will continue the search for a professional for you.
Expert:  Josie-Mod replied 1 year ago.
Thank you for your patience, your business is very important to us, we are waiting on the professional with the right expertise to come online. Please let us know if you would like us to continue searching for a professional or if you would like us to close your question. Thank you for your understanding!
Customer: replied 1 year ago.
Should I offer more money? I can. please let me know.
Expert:  Josie-Mod replied 1 year ago.
Thank you for your reply. Your question is open to all professionals and marked high priority. You'll receive an email notification if a professional replies. We appreciate your patience.
Customer: replied 1 year ago.
I've got all 3 files; the main.cpp, another cpp and a header file (well commented) and I've uploaded to wikisend so all I'm needing the expert to do at this point is fix my code because I've got errors at run/compile time. The link can be found at

http://wikisend.com/download/378350/Bucket.7z

I really need the help. Thank you!
Customer: replied 1 year ago.
I really need your help on another posted problem where I've got all three files down (and really close to the right answer - I know it) but am getting some errors at compile/runtime. It's worth the price to me just to have you check it out and let me know what to fix - I've commented it pretty well:

http://www.justanswer.com/homework/7qjcq-c-question-bucket-sort-program-this-file-contain.html

The 2 cpp files and 1 header file are here:

http://wikisend.com/download/378350/Bucket.7z

Can you take the question? I really liked what you taught me on the last one and I need it since it's due tomorrow. I may be able to fix it, but I really need someone with your skills b/c I am not confident I can. Thanks!
Expert:  Ingo U replied 1 year ago.
Hi,
I took a look at your files; it looks like you're using Windows - how about the compiler? Visual Studio perhaps? If so, can you zip up the whole project folder and upload it? For one, you have an #include "BucketSort.h" but that files is not there.
Thanks,
Ingo U
Customer: replied 1 year ago.

Thank you so much! Yes, I'm using VS 2010 professional. I thought the header file was up there. I apologize. I've put a 7 zip of the entire project at:

 

http://wikisend.com/download/308580/Lawrence_Final.7z

 

Thank you!

Expert:  Ingo U replied 1 year ago.
OK, got it - but is it possible the files somehow got corrupted by 7zip? I'm getting 77 compile errors, much of it due to what looks like file corruption - for example, comments that should start with /* just start with *.
Can you try to just put everything in a windows zip file (compressed folder) to see if that changes anything at my end?
Thanks!
Customer: replied 1 year ago.

OK. I was getting errors as well with compiler. Not that many though, here's the windows zip file:

 

http://wikisend.com/download/239272/Lawrence_Final.zip

 

Thanks again.

Customer: replied 1 year ago.
This is a better version of the file - down to one error and one warning:

http://wikisend.com/download/545606/Lawrence_Final.zip
Expert:  Ingo U replied 1 year ago.
THIS ANSWER IS LOCKED!
You can view this answer by clicking here to Register or Login and paying $3.
If you've already paid for this answer, simply Login.
Ingo U, Software Engineer
Category: Homework
Satisfied Customers: 489
Experience: Over 25 years experience in software development. Expert in Microsoft .Net, C#, C++, VB, SQL
Ingo U and 9 other Homework Specialists are ready to help you
Customer: replied 1 year ago.
That's excellent. Thank you very much!
Expert:  Ingo U replied 1 year ago.
Pleasure to work with you, AND THANKS FOR THE BONUS! Please feel free to request me directly at
http://www.justanswer.com/computer/expert-ingou/

if you'd like to work with me on a future project. If you do, just to be sure, put "FOR INGO ONLY" at the beginning of the subject line.

Regards,
Ingo
Customer: replied 1 year ago.
You as well and thanks again! Will do.

JustAnswer in the News:

 
 
 
Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.
 
 
 

What Customers are Saying:

 
 
 
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
< Last | Next >
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
  • This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!! Alex Los Angeles, CA
  • Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult. GP Hesperia, CA
  • I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin Kernersville, NC
  • Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around. Esther Woodstock, NY
  • Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know. Robin Elkton, Maryland
  • He answered my question promptly and gave me accurate, detailed information. If all of your experts are half as good, you have a great thing going here. Diane Dallas, TX
 
 
 

Meet The Experts:

 
 
 
  • Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4522
    More than 5000 online tutoring sessions.
< Last | Next >
  • http://ww2.justanswer.com/uploads/BU/BusinessTutor/2012-2-2_115741_Kouki2.64x64.jpg Manal Elkhoshkhany's Avatar

    Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4522
    More than 5000 online tutoring sessions.
  • http://ww2.justanswer.com/uploads/ComputersGuru/2010-02-13_051118_Photo41.JPG LogicPro's Avatar

    LogicPro

    Engineer

    Satisfied Customers:

    3458
    Expert in Java C++ C C# VB Javascript Design SQL HTML
  • http://ww2.justanswer.com/uploads/LI/lindaus/2012-6-10_04811_IMG20120609164157.64x64.jpg Linda_us's Avatar

    Linda_us

    Finance, Accounts & Homework Tutor

    Satisfied Customers:

    3124
    Post Graduate Diploma in Management (MBA)
  • http://ww2.justanswer.com/uploads/chooser77/2009-08-18_162025_Chris.jpg Chris M.'s Avatar

    Chris M.

    M.S.W. Social Work

    Satisfied Customers:

    2385
    Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)
  • http://ww2.justanswer.com/uploads/JawaadAhmed/2009-6-27_12137_SIs_SHadi.jpg F. Naz's Avatar

    F. Naz

    Chartered Accountant

    Satisfied Customers:

    1988
    Experience with chartered accountancy
  • http://ww2.justanswer.com/uploads/JK/jkcpa/2011-1-16_182614_jkcpa.64x64.jpg Bizhelp's Avatar

    Bizhelp

    CPA

    Satisfied Customers:

    1876
    Bachelors Degree and CPA with Accounting work experience
  • http://ww2.justanswer.com/uploads/avremote/photoa.jpg Seanna's Avatar

    Seanna

    Tutor

    Satisfied Customers:

    1781
    3,000+ satisfied customers, all topics, A+ work
 
 
 

Related Homework Questions

Chat Now With A Tutor
Ingo U
Ingo U
Tutor
489 Satisfied Customers
Over 25 years experience in software development. Expert in Microsoft .Net, C#, C++, VB, SQL