Glibc 字符串操作函数的算法复杂度 [英] Algorithm complexity of Glibc string manipulation functions

查看:22
本文介绍了Glibc 字符串操作函数的算法复杂度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我意识到 Glibc 源代码经过了极大的优化,并且是手工编码的汇编.有没有分析过strmcpstrncmp等常用字符串操作函数的算法复杂度(Big O)的文档?

I realize that Glibc source code is extremely optimized and is in hand coded assembly. Are there any documents that have analyzed the algorithm complexities (Big O) of commonly used string manipulation functions like strmcp, strncmp, etc?

推荐答案

可能没有相关文档,因为它很简单.strcmpstrncmp 的复杂度为 O(n).

There is probably no documentation on that because it is straightforward. It is O(n) for strcmp and strncmp.

这篇关于Glibc 字符串操作函数的算法复杂度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆