answersLogoWhite

0


Best Answer

If this is a homework related question, you really should consider trying to solve it yourself before looking at this answer. Otherwise, the value of the lesson, and the reinforcement provided by the assignment, will be lost to you.

In a sequential search, where the elements are in a uniformly random distribution, the average number of comparisions to find a particular element is one half of the number of elements.

Stated another way... In a sequential search, where the elements are in an arbitrary distribution, the average number of comparisions to find a random element is one half of the number of elements.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the average number of comparisons in a sequential search?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What will be the average successful time for sequential search on n items?

N/2


How can the content of the array be recorded to improve the average performance in sequential search of reordered?

If you're strictly using a sequential search, then the order of the array's content will make no difference. Whether it's in low-high order, high-low order, or randomized, the time complexity for a sequential search will remain O(n).


Advantages of binary search over sequencial search?

Linear search takes linear time with a worst case of O(n) for n items, and an average of O(n/2). Binary search takes logarithmic time, with a worst and average case of O(n log n). Binary search is therefore faster on average.


How many maximum number of comparisions are required for linear search for n values?

n comparisons.


Can you use a sequential search on an unsorted array?

Sequential search is the only way to search an unsorted array unless you resort to a multi-threaded parallel search where all threads concurrently search a portion of the array sequentially.


The time complexity of the sequential search algorithm is?

O(N) where N is the number of elements in the array you are searching.So it has linear complexity.


Which of the following describes a difference between comparisons and contrasts?

Comparisons focus on highlighting similarities between two or more things, while contrasts emphasize differences between them. Comparisons typically examine how things are alike, while contrasts explore how they are different.


Explain linear search with an example?

Sequential search of an object with in an array of objects is called as linear search.


Is it true In a sequential search each element is compared to the searchValue and the search stops when the value is found or the end of the array is encountered?

As I know the search method depends on your(programmer's) logic. In sequential search it will be better to stop the search as soon as search value encounters or if search value is not in the array then it should stop at the end.


Which one is faster A binary search of an ordered set of elements in an array or a sequential search of the elements?

There is no such thing as an insertion search. There is only insertion sort, which is a method of sorting an unsorted list. Sequential search (or linear search) is only used with unsorted lists. If the list is sorted, a logarithmic search is quicker, by starting from the middle. If the items is not here, it must be in the lower half or the upper half, thus one half of the list can be discarded. You then repeat by starting in the middle of the remaining half. Thus for a list of 15 items, you end up with a list of 7, then 3, then 1, then 0. Thus it takes 5 comparisons to determine that an item does not exist. With linear search it would take 15 comparisons to determine that an item does not exist. Thus logarithmic search is quicker, but only works with sorted lists.


A binary search of an orderd set of elements in an array or a sequential search of the elements.Which one is faster?

A binary search is much faster.


5 Why Searching is slower in Linked-List than in Trees?

Searching is slower for linked-lists rather than (ordered) trees because you need to iterate through each element serially, whereas for an ordered (binary) tree you use a "divide and conquer", otherwise known as binary search, method. Think of it this way. Think of a number between 1 and 128. Perhaps the number is 97. With an ordered list, it would take 97 comparisons to find the item. With an unordered list, it would take an average of 64 comparisons - if the order was random. With a binary tree, i.e. a binary search, you only need 7 comparisons. In fact, you never need more than 7 comparisions for a tree size of 128, and on average, you would use less than that.