编程语言
首页 > 编程语言> > python | split函数时间复杂度

python | split函数时间复杂度

作者:互联网

源码

    while (maxcount-- > 0) {
    while (i < str_len && STRINGLIB_ISSPACE(str[i]))
        i++;
    if (i == str_len) break;
    j = i; i++;
    while (i < str_len && !STRINGLIB_ISSPACE(str[i]))
        i++;
是O(n)

感谢:https://stackoverflow.com/questions/55113713/time-space-complexity-of-in-built-python-functions

标签:python,复杂度,len,++,while,split,str,STRINGLIB
来源: https://www.cnblogs.com/agis/p/16587512.html