hey, brother, I am from Tanzania, you are genius, this was one of difficult part in my c++ class but now see no more cramming, god bless you , programing is not difficult unless you meet wrong teacher, big uppppp
Who does this, who explains a code like this so simply and effortlessly , it's all we need as students ,to get the logic and being able to explain it ourselves to the layman on the street, you explain these algorithms better than my professor, thanks a lot.
If you use int max = 0 instead of int max = arr[0] in your code, it might not work correctly in all cases, especially when the array contains only negative numbers. We can't consider 0 as a least element , if we are using arr[0] we are comparing with first element of array.
please tell me checking the divisibility of 11 without using num modulus 11. for example 20449 is divisible by 11. logic is sum of digits at odd places is 2+4+9 =15.sum of digits at even places is 0+4 =4. . sum at odd places - sum at even places is 0 or 11 0r 22 or things like that then the number is divisible by 11. I think that it should be implemented by using arrrays. another point to be noted is that we can use modulus to separate the digits of the number from the back by using the logic of sum of digits of a number. i will be highly obliged.
pleaase help me on this (only single-time scanning values while so sorting arrays) question: input arr =[1,0,2,0,2,1,3,4,5] output:[0,0,1,1,2,2,3,4,5] but Here only single scanning not repeating the array elements comparison while sorting the array
Hello Sir i just love your videos... make video on following topics...as u miss it out 1.TSP(Dynamic approach) 2.TSP(Branch & bound) 3.and most imp np hard and np complete problem
given a array DATA with N numerical values, this algorithm finds the location LOC and the value MAX of the largest element of DATA in data structure (solution for this question)
Waiylt but wht if all nos r negative this will give 0 as output which is not even present inthe array My suggestion is insted of max = 0 keep max = arr[0]
Yeah, was wondering the same. Do you got any idea to generalise this for an array containing positive and negative numbers both. I am new to programming.