计算机科学中的Big

编程入门 行业动态 更新时间:2024-10-25 10:22:50
本文介绍了计算机科学中的Big-O符号有什么大不了的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

Big-O表示法对我日常的C#编程有何帮助?这只是学术活动吗?

解决方案

Big-O从输入量的角度告诉您算法的复杂性.如果您想知道算法如何扩展,这是基本.如果您正在设计一个大型网站并且您有很多用户,那么处理这些请求所花费的时间就很重要.如果您有大量数据,并且想要将其存储在结构中,那么如果要编写不需要一百万年才能运行的内容,则需要知道如何有效地进行操作.

不是Big-O表示法本身会为您提供帮助.就是说,如果您了解Big-O表示法,便会了解算法的最坏情况下的复杂性.本质上,Big-O可以让您从高层次上了解哪些算法快速,哪些算法较慢以及权衡取舍.如果您不了解,那么我看不到如何理解.NET集合库中任何内容的性能含义.

由于这里的问题已经很多次了,但在这里我将不做详细介绍,但足够了说这是您应该理解的.这是一个投票率很高的>之前的Big-O问题,可以帮助您入门./p>

How would Big-O notation help in my day-to-day C# programming? Is it just an academic exercise?

解决方案

Big-O tells you the complexity of an algorithm in terms of the size of its inputs. This is essential if you want to know how algorithms will scale. If you're designing a big website and you have a lot of users, the time it takes you to handle those requests is important. If you have lots of data and you want to store it in a structure, you need to know how to do that efficiently if you're going to write something that doesn't take a million years to run.

It's not that Big-O notation itself will help you. It's that if you understand Big-O notation, you understand the worst-case complexity of algorithms. Essentially, Big-O gives you a high-level sense of which algorithms are fast, which are slow, and what the tradeoffs are. I don't see how you can understand the performance implications of anything in, say, the .NET collections library if you don't understand this.

I won't go into more detail here, since this question has been asked many times, but suffice it to say that this is something you should understand. Here's a fairly highly voted previous Big-O question to get you started.

更多推荐

计算机科学中的Big

本文发布于:2023-11-28 20:45:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1643891.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:计算机科学   Big

发布评论

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

>www.elefans.com

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