Added: 1 year ago
From: njoker555
Views: 9,499
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (41)

Sign In or Sign Up now to post a comment!
  • Hi, can you help me with my project? can you do a tutorial for a 6174 problem? where the user can input a 4-digit number , and arrange the digits of the given number in ascending order. Next, arrange the same digits in descending order. then Find the difference between the two arranged numbers. Use this as the next number in the sequence.

    The sequence will eventually repeat at 0 (if all digits are the same) or, For 3- and 4-digit numbers, these are the single numbers 495 and 6174. Thanks :)

  • @KamilleCarreon you should be able to pull out each digit using modulus (%) and put them in an array and run the bubble sort that I show in this tutorial. You'd need to set up some extra steps with a while loop so that it keeps repeating until it hits 0.

    I can't help you write the program from scratch, however, if you have something written out, you can email me through the Easy programming website with any questions and I'll be happy to help.

    Good luck.

  • great tutorial! do you have a tutorial for selection sort?

  • @jannyjoyzee take a look at my Index sort tutorial.

  • how would this program look with functions, is it possible you make a video of it and explain it?

  • @brawl313 watch tutorial 25, it's titled "Index sort with void functions" - the index sort is similar to the bubble sort but it changes around the indexes of the arrays and I show you how to use functions with the sort. It's also the video response to this video.

  • @njoker555 oh okay, thanks a lot. Great videos by the way. Easy to follow explanations.

  • @brawl313 no problem and thank you :) glad you find them useful. 

  • Is there a Bubble sort or a Selection sort in video?? As I think this is selection sort.

  • @MultiDoMore This is the bubble sort, you should look at my index sort video, that should be what you're looking for in terms of selection sort.

  • Great video, thanks so much

  • Great, it helps to understand bubble sirt very easily.

  • good job :)

  • Ur tutorials are better than my 2 hour mon we'd lecture ...don't know why those tenured jerks get paid so much to do nothing...

  • @NYMPHOBEATZ I've been there myself :) it's one of the reasons I decided to create these tutorials. But my tuts are far from perfect.

  • Thanks for the reply ur video helped, but Is selection sort the same as index or bubble sort? I'll check out the other and get that running..thanks again tutoria

  • @NYMPHOBEATZ Yeah I believe they are the same since they both move around the subscript values of the arrays. All these sorts end up having similar, if not the same, lines of codes.

  • How would I ad a function to do the sorting?

  • @NYMPHOBEATZ do you mean how you would put the sorting code into a function? If yes, I have a video with the title "Index Sort with Void Functions" - the Index Sort is similar to the Bubble Sort and there I show you how to easily put the sorting code into a function that you call to in the main program.

  • how about with filestream and i need to make both ascending and descending sorting? kinda confused lol

  • @domeee11 if you already know how to read from a file, then this shouldn't be too difficult, you should open the file and read everything inside and then make it go through the bubble sort. Unfortunately, I don't cover fstream in any of my tutorials yet, I plan on it for the future. But if you have codes already and have specific questions about them, feel free to contact me, I'll help where ever I can :)

  • @njoker555 hey thanks for the reply.. i figured it out just after i watch your video.. thanks a LOT btw.. i missed my class when the teacher explains this, and u save my day.. ill send you my code, just for reference :)

  • @domeee11 glad my video helped :)

  • thanks for the video man, you explained this perfectly I had read up on alot of things on the code of bubble sorting and nothing made sense.

    this video was perfect

  • @ughLACARI I'm glad it helped :)

  • thank you very much! was very useful

  • In other bubble sort implementations I have seen they keep track of if there was a swap in the inner loop and only run as long as there was a swap. This often more efficient and is quite fast for already sorted sets.

  • Thanks so much for making these tutorials, I accidentally deleted my notes from my C++ class and was completely lost on bubble sorting. I couldn't find help anywhere else online because apparently everyone else out there seems to think that just because you have a question means you want someone else to do your homework for you. All I needed was a demonstration and explanation and your video did that very well.

  • @a4nandez glad the video helped then :) and thanks for your kind comment, means a lot to know people are watching and that it's helping some people.

  • @njoker555

    I'm just a beginner so If I'm wrong then please correct me. Are you sure this is a bubble sort?

    You are comparing if(numb[i] > numb[j]

    here if i = 0 then numb[j] = 1( i+1)

    In this case for the nested loop,

    you are comparing values numb[i=0] and with numb[j=1]

    and then [i=0] with numb[j=2], and with numb[j=3].. and keep swamping value of numb[i=0]. I don't think this is bubble sort. It will sort because you have correct logic. Due to word restrictions I can't explain further.

  • @subjugator7 I'm sure in a bubble sort :)

    You just have to imagine it like the bigger numbers are slowly moving outwards while the smaller ones are being pushed in. It may not resemble a bubble perfectly, but that's basically the point. That's how I learned it anyway :)

  • thank you so much....

    now i can proudly pass my assignment

    heheheh....

  • ok, thanks for that.

    i will let you no if i got any problem

    have a good one

    by the way your videos are very helpful i like

  • @ALHABBAD no problem and thank you :)

  • i have some difficulty to do my HW assignment in C++

    would you like to work with me and i am gonna pay you for that.

    if yes how could i send you the assignment and how could i pay you

  • @ALHABBAD well, I won't do any work for you so I won't accept any payment. If you're stuck on a certain line or error, you can pass that to me and I'll try to help you that way but I can't work with you to write a program from scratch.

  • i have some difficulty to do my HW assignment in C++

    would you like to work with me and i am gonna pay you for that.

    if yes how could i send you the assignment and how could i pay you

  • @ALHABBAD you can contact me by pm if you need help or just comment on my videos - I check almost everyday (sometimes several times a day)

  • appreciate the time spent and video

  • @TheSteamboats thanks :) glad you like it.

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more