answersLogoWhite

0

#include<stdio.h>

#include<conio.h>

void main()

{

int a[6],i,data,pos;

clrscr();

printf("enter the element of the array");

for(i=0;i<6;i++)

{

scanf("%d",&a[i]);

}

printf("enter the data for search");

scanf("%d",&data);

for(i=0;i<6;i++)

{

if(a[i]==data)

{

pos=i+1;

break;} }

if(pos==i+1)

printf("position of the element is %d",pos);

else

printf("this is not element in this array ");

getch();

}

( form giriver bisht (future hacker and networking engineer;; if any problem persist u can call me at this no. .. (dehradun 8439881423 )

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

Which search algorithm requires that the arrays contents be sorted?

Binary Search Algorithm


Give you the algorithm of creating a new binary search tree using c?

i want to know how to give the algorithm password in a computer ?


What is the best search algorithm to use for a sorted array?

The best search algorithm to use for a sorted array is the binary search algorithm.


What is the running time of binary search algorithm?

The running time of the binary search algorithm is O(log n), where n is the number of elements in the sorted array being searched.


What is the time complexity of a binary search algorithm?

The time complexity of a binary search algorithm is O(log n), where n is the number of elements in the sorted array being searched.


What is the time complexity of a binary search algorithm in computer science?

The time complexity of a binary search algorithm in computer science is O(log n), where n is the number of elements in the sorted array being searched.


What is the time complexity of an algorithm that utilizes a binary search algorithm to search through a sorted array, where the search time is represented by the function log(n) in terms of the input size n?

The time complexity of an algorithm that uses a binary search on a sorted array is O(log n), where n is the size of the input array.


The order of binary search algorithm is?

n log n - G.Parthiban, SRM


How do you print all data in a Binary Search Tree?

By using Depth First Search or Breadth First search Tree traversal algorithm we can print data in Binary search tree.


What is the time complexity of an algorithm that uses a binary search to find an element in a sorted array in logn time?

The time complexity of an algorithm that uses binary search to find an element in a sorted array in logn time is O(log n).


How can one perform a binary search?

One can perform a binary search easily in many different ways. One can perform a binary search by using an algorithm specifically designed to test the input key value with the value of the middle element.


How many comparisons are typically made in a binary search algorithm when searching for a specific element in a sorted array?

In a binary search algorithm, typically log(n) comparisons are made when searching for a specific element in a sorted array, where n is the number of elements in the array.