Click here to Skip to main content
15,887,446 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How do I calculate computational and time complexity of naive string search algorithm?
Posted
Updated 24-Feb-16 0:49am
v2
Comments
Patrice T 24-Feb-16 6:43am    
The answer depend of actual code.

1 solution

The same way you do for any other operation:
"You add up how many machine instructions it will execute as a function of the size of its input, and then simplify the expression to the largest (when N is very large) term and can include any simplifying constant factor."

Source: How to find time complexity of an algorithm - Stack Overflow[^] - and it's about the most succinct definition I've seen!
But basically, it means exactly what ppolymorphe said: "The answer depend of actual code."
More detailed explanation as to how to work it out: Complexity and Big-O Notation[^]
This isn't something we can do for you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900