Help! I need a little help starting this project its my final

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Mar 2008
Posts: 18
Reputation: sanfan49er is an unknown quantity at this point 
Solved Threads: 0
sanfan49er's Avatar
sanfan49er sanfan49er is offline Offline
Newbie Poster

Help! I need a little help starting this project its my final

 
0
  #1
Sep 8th, 2008
CIS350 Project
Choose one O(n log n) and one O(n2) sorting algorithm. Choose a third algorithm of any time complexity. For each of the three algorithms you have chosen, implement the algorithm.
Then, write a short piece of code that will generate the following:
1. A file of 1000 random integers
2. A file of 10000 random integers
3. A file of 100000 random integers
Run your three sorting routines and, using C++ library functions, time the execution of each of the three routines on the three data sets. Graph the results. Then, write a brief analysis and summary of the results.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 3,822
Reputation: VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute 
Solved Threads: 501
Featured Poster
VernonDozier VernonDozier is offline Offline
Senior Poster

Re: Help! I need a little help starting this project its my final

 
0
  #2
Sep 8th, 2008
Originally Posted by sanfan49er View Post
CIS350 Project
Choose one O(n log n) and one O(n2) sorting algorithm. Choose a third algorithm of any time complexity. For each of the three algorithms you have chosen, implement the algorithm.
Then, write a short piece of code that will generate the following:
1. A file of 1000 random integers
2. A file of 10000 random integers
3. A file of 100000 random integers
Run your three sorting routines and, using C++ library functions, time the execution of each of the three routines on the three data sets. Graph the results. Then, write a brief analysis and summary of the results.
What's the question? No one is going to do the whole thing for you without any effort on your part.
http://www.daniweb.com/forums/announcement8-2.html
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 1,845
Reputation: ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all 
Solved Threads: 119
ithelp's Avatar
ithelp ithelp is offline Offline
Posting Virtuoso

Re: Help! I need a little help starting this project its my final

 
0
  #3
Sep 10th, 2008
Search for quick sort and bubble sort , this will help you finish your final year project assignment.
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 59
Reputation: Dannyo329 is an unknown quantity at this point 
Solved Threads: 6
Dannyo329's Avatar
Dannyo329 Dannyo329 is offline Offline
Junior Poster in Training

Re: Help! I need a little help starting this project its my final

 
0
  #4
Sep 10th, 2008
Go eat a can and put your best effort in to it.
C programmers will get smashed by C++ programmers.
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 55
Reputation: MelechM is an unknown quantity at this point 
Solved Threads: 6
MelechM MelechM is offline Offline
Junior Poster in Training

Re: Help! I need a little help starting this project its my final

 
0
  #5
Sep 10th, 2008
Try and start it at least. I think an array of a bunch of numbers would work fine, user inputs the amount of numbers to be generated (to show your professor it works you can input 1000, 10000, and 100000) and then the output is a bunch of numbers from the array.
Sir, they have us surrounded; those poor bastards
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 36
Reputation: Alexpap is an unknown quantity at this point 
Solved Threads: 0
Alexpap Alexpap is offline Offline
Light Poster

Re: Help! I need a little help starting this project its my final

 
0
  #6
Sep 11th, 2008
try the following for a buble sort Ascenting. I think that will help you.All im doing is swaping the values, just like a swap algorithm.

Happy Coding!

  1. private: System::Void btnSort_Click(System::Object^ sender, System::EventArgs^ e)
  2. {
  3.  
  4. lsv->Items->Clear();
  5. int temp;
  6. String^ Stemp;
  7. float ftemp;
  8.  
  9. for ( int i = 1;i < Employee_sum;i++ )
  10. {
  11. for ( int j = Employee_sum- 1; j >= i; j--)
  12. {
  13. if ((employee[j-1]->GetAFM()) > (employee[j]->GetAFM()))
  14. {
  15. temp = employee[j-1]->GetAFM();
  16. employee[j-1]->SetAFM(employee[j]->GetAFM());
  17. employee[j]->SetAFM(temp);
  18.  
  19. Stemp = employee[j-1]->GetLName();
  20. employee[j-1]->SetLName(employee[j]->GetLName());
  21. employee[j]->SetLName(Stemp);
  22.  
  23. Stemp = employee[j-1]->GetFName();
  24. employee[j-1]->SetFName(employee[j]->GetFName());
  25. employee[j]->SetFName(Stemp);
  26.  
  27. temp = employee[j-1]->GetSalary();
  28. employee[j-1]->SetSalary(employee[j]->GetSalary());
  29. employee[j]->SetSalary(temp);
  30.  
  31. ftemp = employee[j-1]->GetTax();
  32. employee[j-1]->SetTax(employee[j]->GetTax());
  33. employee[j]->SetTax(ftemp);
  34.  
  35. ftemp = employee[j-1]->GetIKA();
  36. employee[j-1]->SetIKA(employee[j]->GetIKA());
  37. employee[j]->SetIKA(ftemp);
  38.  
  39. ftemp = employee[j-1]->GetTEBE();
  40. employee[j-1]->SetTEBE(employee[j]->GetTEBE());
  41. employee[j]->SetTEBE(ftemp);
  42.  
  43. ftemp = employee[j-1]->GetNet();
  44. employee[j-1]->SetNet(employee[j]->GetNet());
  45. employee[j]->SetNet(ftemp);
  46. }
  47. }
  48. }
  49. }
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 36
Reputation: Alexpap is an unknown quantity at this point 
Solved Threads: 0
Alexpap Alexpap is offline Offline
Light Poster

Re: Help! I need a little help starting this project its my final

 
0
  #7
Sep 11th, 2008
try the following for an Ascenting buble sort . I think that will help you.All im doing is swaping the values, just like a swap algorithm.

Happy Coding!

  1. private: System::Void btnSort_Click(System::Object^ sender, System::EventArgs^ e)
  2. {
  3.  
  4. lsv->Items->Clear();
  5. int temp;
  6. String^ Stemp;
  7. float ftemp;
  8.  
  9. for ( int i = 1;i < Employee_sum;i++ )
  10. {
  11. for ( int j = Employee_sum- 1; j >= i; j--)
  12. {
  13. if ((employee[j-1]->GetAFM()) > (employee[j]->GetAFM()))
  14. {
  15. temp = employee[j-1]->GetAFM();
  16. employee[j-1]->SetAFM(employee[j]->GetAFM());
  17. employee[j]->SetAFM(temp);
  18.  
  19. Stemp = employee[j-1]->GetLName();
  20. employee[j-1]->SetLName(employee[j]->GetLName());
  21. employee[j]->SetLName(Stemp);
  22.  
  23. Stemp = employee[j-1]->GetFName();
  24. employee[j-1]->SetFName(employee[j]->GetFName());
  25. employee[j]->SetFName(Stemp);
  26.  
  27. temp = employee[j-1]->GetSalary();
  28. employee[j-1]->SetSalary(employee[j]->GetSalary());
  29. employee[j]->SetSalary(temp);
  30.  
  31. ftemp = employee[j-1]->GetTax();
  32. employee[j-1]->SetTax(employee[j]->GetTax());
  33. employee[j]->SetTax(ftemp);
  34.  
  35. ftemp = employee[j-1]->GetIKA();
  36. employee[j-1]->SetIKA(employee[j]->GetIKA());
  37. employee[j]->SetIKA(ftemp);
  38.  
  39. ftemp = employee[j-1]->GetTEBE();
  40. employee[j-1]->SetTEBE(employee[j]->GetTEBE());
  41. employee[j]->SetTEBE(ftemp);
  42.  
  43. ftemp = employee[j-1]->GetNet();
  44. employee[j-1]->SetNet(employee[j]->GetNet());
  45. employee[j]->SetNet(ftemp);
  46. }
  47. }
  48. }
  49. }
[/QUOTE]
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC