Find First and Second Biggest In An Array, Without Sorting It: C



http://technotip.com/1524/find-first-and-second-biggest-in-an-array-without-sorting-it-c/ if a[i] contains a number which is bigger than fbig, we transfer the value of a[i] to fbig and the value present in fbig to sbig; If the value of a[i] is not bigger than fbig, then we check it with sbig. If a[i] is bigger than sbig, then we assign the value of a[i] to sbig.

Comments

  1. Agar zor se bolte to shayd samjh aajata :/
  2. you could add this in the code and it will work for repeating numbers in the array as well
    "else if (a[i] > sbig && a[i] != max1)"
  3. check for folloing input
    21,25,20,33,33,10,8,9,30
  4. simple and easy to understandable
  5. great job!!
  6. easy to understand and implement sir.super!!!!!!!!!!!!!!
  7. I am the 5000th subscriber! Where's my gift? :p
  8. What about a third largest number? Otherwise, very useful concept. I'll be referencing this often!
  9. its very usefull for me to understand the concept behind the program. I wish u to upload still more videos
  10. superb


Additional Information:

Visibility: 18371

Duration: 7m 53s

Rating: 126