how can i search an element in an array
Answer Posted / pavan_mustyala
In C-Language, In general, we compare each element of the
array in a loop that iterates till the element is found.
This is called Linear search.
while(1)
{
// code here
if(element found)
break;
}
Here, execution time depends on the array size and position
of the element in the array.
For sorted arrays, we can use techniques such as binary
search using which execution is faster.
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
how to test pierrot divisor
write a program for area of circumference of shapes
Develop a routine to reflect an object about an arbitrarily selected plane
write a function to give demostrate the functionality of 3d in 1d. function prototye: change(int value,int indexX,int indexY,int indexZ, int [] 1dArray); value=what is the date; indexX=x-asix indexY=y-axis indexZ=z-axis and 1dArray=in which and where the value is stored??
Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines
Sir... please give some important coding questions asked by product companies..
Write a program to model an exploding firecracker in the xy plane using a particle system
write a c program to input initial & final time in the format hh:mm and find the time intervel between them? Ex inputs are initial 06:30 final 00:05 and 23:22 final 22.30
Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?
Write a Program in 'C' To Insert a Unique Number Only. (Hint: Just Like a Primary Key Numbers In Database.) Please Some One Suggest Me a Better Solution for This question ??
Write a routine to implement the polymarker function
Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange
To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates. String contains only lowercase characters ['a'-'z']
can you use proc sql to manpulate a data set or would u prefer to use proc report ? if so why ? make up an example and explain in detail
why nlogn is the lower limit of any sort algorithm?