算法PHP函数的strlen的复杂性()

编程入门 行业动态 更新时间:2024-10-24 09:24:13
本文介绍了算法PHP函数的strlen的复杂性()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

最近有人问我在采访这个问题,我不知道该怎么回答。

Recently I was asked this question on interview and I didn't know how to answer it.

任何人都可以回答这个问题,并形容它?

Can anyone answer this question and describe it?

推荐答案

O(1),因为长度存储为一个属性:的来源

O(1) since the length is stored as an attribute: source

不过,这种小事是值得的的反制的有关微优化影院的讨论,因为承蒙我们的东道主提供的here和这里;阅读这两个环节,你会找到一个很好的谈论的焦点,以改变会话下一次类似的问题上来的气势,不管你是否知道具体的答案!

However, this trivia is worth countering with a discussion about micro-optimising theatre, as kindly provided by our hosts here and here; read those two links and you'll find a good talking point to change the momentum of the conversation next time similar questions come up, regardless of whether you know the particular answer!

如何面试官的反应,以你的切线会告诉你很多关于你是多么想与他们合作。

How the interviewer reacts to your tangent will tell you a lot about how much you want to work with them..

更多推荐

算法PHP函数的strlen的复杂性()

本文发布于:2023-11-30 15:05:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1650439.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:复杂性   算法   函数   PHP   strlen

发布评论

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

>www.elefans.com

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