Skip to main content

All Questions

2 votes
3 answers
2k views

Is the Time complexity of this function o(n) ? Can it be optimized any further?

This is a very simple function to find if a string is composed of unique characters. I believe that this is a O(n) time complexity as it loops once and has a single if condition. Am I correct? Is ...
Pradeepl's user avatar
  • 133
0 votes
3 answers
2k views

Best algorithm to determine whether two arrays can be the same in a circular queue

I'm trying to figure out an efficient way to determine whether two distinct arrays of the same size can be shifted to form the same circular queue. For example: Array1 = ['A','B','C','D'] Array2 = ['...
Tyress's user avatar
  • 153