Why the liner search algorithm also called sequential search

Why the liner search algorithm also called \"sequential search\" How do you return a value from function? What is the difference between a size declaration and a subscript? What does each of the following statement display cout

Solution

2.public String validate(String str)

{

.................

.............

return \"String\"

}//This is for string as link float,void,double etc.

3.

The size declarator is used in a definition of an array to indicate the number of
elements the array will have. A subscript is used to access a specific element in an
array.
2. The array has 10 elements.
The subscript of the first element is 0.
The subscript of the last element is 9.
Using four-byte integers, this array uses 40 bytes of memory.
3. Because, with the array alone the function has no way of determining the number
of elements it has.
4. 2
14
8
5. By providing an initialization list. The array is sized to hold the number of values
in the list.
6. 3
0
7. Because an array name without brackets and a subscript represents the array\'s
beginning memory address. The statement shown attempts to assign the address
of array2 to array1, which is not permitted.
8. No.
9. By reference.
10. The array\'s beginning memory address.
11. By using the same subscript value for each array.
12. Eight elements
Yes, it is null terminated.
13. Eight rows
Ten columns
Eighty elements
sales[7][9] = 123.45;
14. The second size declarator, which is for the number of columns.
15.
• You do not have to declare the number of elements that a vector will have.
• If you add a value to a vector that is already full, the vector will
automatically increase its size to accommodate the new value.
• A vector can report the number of elements it contains.
16. size declarator
17. integer, 0
18. subscript
19. 0
20. size declarator, subscript
21. bounds
22. initialization

1. Ans

it is possible to take greater advantage of the ordered list if we are clever with our comparisons. In the sequential search, when we compare against the first item, there are at most n1n1 more items to look through if the first item is not what we are looking for. Instead of searching the list in sequence, a binary search will start by examining the middle item

Sequential Search  
- It is easy.  
- It needs not to be sorted.
- To search the last element we have element we to scan all the elements.
- If the element is first, then it’s best case bcoz the element is found at first position.  


Binary Search
- It is complicated.
- It needs to be sorted.
- To search the last element we don\'t have to search all elements.
- If the element is first, then also we have to check for some of the elements (average case).

Both are having comman critiria that\'s way.its call

4.value[4] is a array the its returns index value

5.add two index values and return result.

6.add value to number variable its return as a pointer i hope is wrong

 Why the liner search algorithm also called \
 Why the liner search algorithm also called \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site