List all the steps used to search for 9 in the sequence 1,3,4,5,6,8,9,11 using linear search

Ramsey 2021-02-02 Answered
List all the steps used to search for 9 in the sequence 1,3,4,5,6,8,9,11 using linear search
You can still ask an expert for help

Want to know more about Discrete math?

Expert Community at Your Service

  • Live experts 24/7
  • Questions are typically answered in as fast as 30 minutes
  • Personalized clear answers
Learn more

Solve your problem for the price of one coffee

  • Available 24/7
  • Math expert for every subject
  • Pay only if we can solve it
Ask Question

Expert Answer

hesgidiauE
Answered 2021-02-03 Author has 106 answers

It's not at all clear from your question how much detail is expected or whether the steps are to be implemented by a computer or a human. For example, do we need to include steps like "copy value X into memory register Y" or "go grab a sheet of paper to write on"? It's also not clear whether you just want a True or False returned or the position in the list.
But here's the basic procedure that you should be able to complexify as you require.
Check if 1==9. It does not.
Check if 3==9. It does not.
Check if 4==9. It does not.
Check if 5==9. It does not.
Check if 6==9. It does not.
Check if 8==9. It does not.
Check if 9==9. It does.
Return True.
The basic idea of linear search is to start at the beginning of the list and just keep going through it until you find the value you're looking for or run out of numbers in your list, whichever happens first.

Not exactly what you’re looking for?
Ask My Question

Expert Community at Your Service

  • Live experts 24/7
  • Questions are typically answered in as fast as 30 minutes
  • Personalized clear answers
Learn more

You might be interested in

asked 2021-07-28

Let A, B, and C be sets. Show that (AB)C=(AC)(BC)
image

asked 2020-11-09
Use proof by Contradiction to prove that the sum of an irrational number and a rational number is irrational.
asked 2021-08-18
Discrete Mathematics Basics
1) Determine whether the relation R on the set of all Web pages is reflexive, symmetric, antisymmetric, and/or transitive, where (a,b)R if and only if
I) everyone who has visited Web page a has also visited Web page b.
II) there are no common links found on both Web page a and Web page b.
III) there is at least one common link on Web page a and Web page b.
asked 2021-08-15
How many elements are in the set { 0, { { 0 } }?
asked 2022-07-08
Discrete math: logical equivalent statement and statement forms
"Two statement forms are called logically equivalent if, and only if, they have identical truth values for each possible substitution of statements for their statement variables... denoted P Q.
Two statements are called logically equivalent if, and only if , they have logically equivalent forms when identical component statement variables are used to replace identical component statements."
Later in the exercise section she writes: p =" x > 5 ". Do you not use for statement definitions and if so, how do you symbolise equivalence between two statements, p q or p = q.
Since p and q by them selves could technically be seen as statement forms, is there a difference between p q and p = q?
asked 2021-08-12
Give the first six terms of the following sequences. You can assume that the sequences start with an index of 1. Logs are to base 2. Indicate whether the sequence is increasing, decreasing, non-increasing, or non-decreasing. The sequence may have more than one of those properties.
a) The first two terms in the sequence are 1. The rest of the terms are the sum of the two preceding terms plus 1.
b) The n-th term is n3.
c) The n-th term is 2n5.
asked 2022-07-01
Let A 1 , A 2 , P be CPOs and let ψ : A 1 × A 2 P be a map, then ψ is continuous it is so in each variable separately
Proving this direction is quite easy, but I am not sure how to conclude the opposite direction:
If D = ( d 1 , d 2 ) = ( D 1 × D 2 ) , we have:
ψ ( D ) = ψ ( d 1 , d 2 ) = ψ d 1 ( d 2 ) = ψ d 2 ( d 1 ) , where
ψ d 1 ( d 2 ) = ψ D 1 ( D 2 ) = ψ D 1 ( D 2 ) = ψ ( { D 1 } × D 2 )
and, similarly,
ψ d 2 ( d 1 ) = ψ D 2 ( D 1 ) = ψ D 2 ( D 1 ) = ψ ( D 1 × { D 2 } )
how to conclude that ψ ( D ) = ψ ( D ) ?

Solve your problem for the price of one coffee

  • Available 24/7
  • Math expert for every subject
  • Pay only if we can solve it
Ask Question