what is space complexity if we have to check anagram using array of length 26, where 26 is english alphabet. It will be constant space or o(n)

前端 未结 0 1417
遇见更好的自我
遇见更好的自我 2021-02-09 00:42

if we have array,

int[] arr=new arr[26];

so we can have an input string of one character or a million of characters. Anagram will be checked only by the array of 2

相关标签:
回答
  • 消灭零回复
提交回复
热议问题