What is linear search?



What is linear search?..

Answer / Santosh Kumar Kanhiya

Linear Search is a simple searching algorithm that iterates through each element of an array from the beginning until the desired element is found or the end of the array is reached. It checks each element one by one, and if it finds the target element, it returns its index. If the target element is not present in the list, then linear search returns -1.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

what is the answer for it main() { int i; clrscr(); printf("%d",&i)+1; scanf("%d",i)-1; }

3 Answers  


What is the difference between void main and main in c?

1 Answers  


How to write a code for implementing my own printf() and scanf().... Please hep me in this... I need a guidance... Can you give an coding for c... Please also explain about the header files used other than #include<stdio.h>...

1 Answers  


Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?

1 Answers  


Write a function that will take in a phone number and output all possible alphabetical combinations

1 Answers   Motorola,


What does the message "automatic aggregate intialization is an ansi feature" mean?

1 Answers  


What is the output of the below program and how it is? void main() { static int var=5; printf("%d",var--); if(var) main(); }

8 Answers   MindFire, TCS, Tech Mahindra,


Explain the concept and use of type void.

1 Answers  


How to reverse alternate words in a given line of string For Eg: my name is narasimha output : my eman is ahmisaran

0 Answers  


how 2 compile & execute c program with out using editor?

2 Answers   HP,


WHO WROTE C LANGUAGE?

4 Answers  


difference between memcpy and strcpy

1 Answers  


Categories