• Register
0 votes
37 views

Problem:

I am new and learning, I need help, can anyone help by filling in the blanks?
The _________ is adequate for searching through small arrays?
A) binary
B) unary
C) linear search
D) relative
E) None of these
7 5 3
5,380 points

1 Answer

0 votes

Solution:

The correct answer is liner serach.

Explanation 

Linear search is a very simple search algorithm. In this type of search, a sequential search is made over all items one by one. Every item is checked and if a match is found then that particular item is returned, otherwise the search continues till the end of the data collection.

Algorithm

Linear Search ( Array A, Value x)

Step 1: Set i to 1
Step 2: if i > n then go to step 7
Step 3: if A[i] = x then go to step 6
Step 4: Set i to i + 1
Step 5: Go to Step 2
Step 6: Print Element x Found at index i and go to step 8
Step 7: Print element not found
Step 8: Exit

 

Pseudocode

procedure linear_search (list, value)

   for each item in the list
      if match item == value
         return the item's location
      end if
   end for

end procedure

 

 

This will guide you.

 

8 5 2
10,530 points

Related questions

0 votes
1 answer 37 views
37 views
Problems: Can anyone give the right solution? What is the simplest and least expensive of external drive arrays?
asked Feb 14 maddi86 5.4k points
0 votes
1 answer 74 views
74 views
Problem: I am new and learning, I need help, can anyone help by filling in the blanks? A(n) ________ search uses a loop to sequentially step through an array? A) binary B) unary C) linear D) relative E) None of these
asked Feb 21 maddi86 5.4k points
0 votes
2 answers 26 views
0 votes
1 answer 21 views
21 views
Problems: Can anyone give the right solution? What term is used to describe the unused space at the end of the last cluster?
asked Feb 14 maddi86 5.4k points
0 votes
1 answer 11 views
11 views
I noticed that in the loop of STATEMENT 1 we put (* p ++) and supposedly this represents that it is going to loop through an element of the array. But I start to think that the logical thing would be that if my pointer is starting at position [0]; in the loop of DECLARATION 1 I would start saving it in position ... position" << i << ":"; cin >> * p;         * p ++;     } * /          return 0; }
asked Aug 14 game 4.6k points