草庐IT

isAnagramOfPalindrome

全部标签

PHP 内置函数复杂性(isAnagramOfPalindrome 函数)

过去2小时我一直在谷歌搜索,但找不到php内置函数时间和空间复杂度的列表。我有isAnagramOfPalindrome要解决的问题具有以下最大允许复杂度:expectedworst-casetimecomplexityisO(N)expectedworst-casespacecomplexityisO(1)(notcountingthestoragerequiredforinputarguments).其中N是输入字符串的长度。这是我最简单的解决方案,但我不知道它是否在复杂性限制之内。classSolution{//Functiontodetermineiftheinputstrin

PHP 内置函数复杂性(isAnagramOfPalindrome 函数)

过去2小时我一直在谷歌搜索,但找不到php内置函数时间和空间复杂度的列表。我有isAnagramOfPalindrome要解决的问题具有以下最大允许复杂度:expectedworst-casetimecomplexityisO(N)expectedworst-casespacecomplexityisO(1)(notcountingthestoragerequiredforinputarguments).其中N是输入字符串的长度。这是我最简单的解决方案,但我不知道它是否在复杂性限制之内。classSolution{//Functiontodetermineiftheinputstrin