Join the QuestionCove community and study together with friends!
Sign Up
OpenStudy (anonymous):
how many no.s are given??
OpenStudy (anonymous):
its a sequence of numbers from 1 to n distinct
OpenStudy (anonymous):
use an array to store this numbers. compare the first element of the array with the rest. if any no becomes smaller than the first no. while checking then replace the first no with the smaller one and continue the checking the the new no. at last you will get the smallest no. at the first position.
OpenStudy (anonymous):
write algo that returns index of the first item that is less than its predecessor in sequence S1 ............. Sn, if s in nondecreasing order that algo returns the value 0
OpenStudy (anonymous):
do u know C language?
Still Need Help?
Join the QuestionCove community and study together with friends!
Sign Up
OpenStudy (anonymous):
ya i know
OpenStudy (anonymous):
do u want the algo?
OpenStudy (anonymous):
yes
OpenStudy (anonymous):
take c as a array.
c={1st , 2nd,........nth}
for (i=0:1<n:i++)
{
if (c(0)<=c(i))
c(0)=c(i);
}
printf("\n %f ",c(0));
OpenStudy (anonymous):
i think it works
Still Need Help?
Join the QuestionCove community and study together with friends!