如何计算天真字符串搜索算法的计算和时间复杂度?

编程入门 行业动态 更新时间:2024-10-10 13:14:05
本文介绍了如何计算天真字符串搜索算法的计算和时间复杂度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何计算天真字符串搜索算法的计算和时间复杂度?

How do I calculate computational and time complexity of naive string search algorithm?

推荐答案

与其他任何操作相同: 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."

资料来源:如何找到算法的时间复杂度 - Stack Overflow [ ^ ] - 它是关于我见过的最简洁的定义! 但基本上,它意味着正是ppolymorphe所说的:答案取决于实际代码。 关于如何解决问题的更详细说明:复杂性和大O符号 [ ^ ] 这不是什么我们可以为你做。

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.

更多推荐

如何计算天真字符串搜索算法的计算和时间复杂度?

本文发布于:2023-11-29 13:51:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1646570.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:复杂度   字符串   算法   天真   时间

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!