Home > Back-end >  Sequential search to find out where all elements in the array is
Sequential search to find out where all elements in the array is

Time:12-17

Sequential search to find out where all elements in the array is

CodePudding user response:

A for loop can
For example,
Int a []=,2,3,1,4,5,1,6,7,1,8,9 {1};
Int q=1, I;
for(i=0; i<13; I++) {
If (a==q [I]) {//if the search data elements and q
Printf (" % d ", I);//print all find the location of the I
}
}

CodePudding user response:

reference 1st floor qybao response:
a for loop can
For example,
Int a []=,2,3,1,4,5,1,6,7,1,8,9 {1};
Int q=1, I;
for(i=0; i<13; I++) {
If (a==q [I]) {//if the search data elements and q
Printf (" % d ", I);//print all find the location of the I
}
}
with dichotomy

CodePudding user response:

How to use all the elements in the array dichotomy found position
  • Related