Is my Big O approximations correct?
<p>I have an algorithm to determine if two strings are permutations of each other. The code can be found here: <a href="https://jsfiddle.net/bxohcgjn/" rel="nofollow noreferrer">https://jsfiddle.net/bxohcgjn/</a></p>

<pre><code>N = String A
M = String B
For time complexity, i have: O(N(N logN + M logM))
For space complexity, I have: O(N + M)

N logN = for sorting A
M logM = for sorting B
</code></pre>

<p>I understand that the browser's implementation for sort will change it, but I am assuming quicksort.</p>

<p>Just want to see if my thinking is correct on this.</p>