Click here to Skip to main content
15,897,718 members

Comments by Black Mamba Elapidae (Top 24 by date)

Black Mamba Elapidae 8-May-22 10:08am View    
@OriginalGriff : Thank you for your time to comment here. Sorry for just writing my assumption and not the thought process behind it, I have updated comment below question to explain it.

Lastly, No, I dont get paid for calculating complexity of simple code and also this is not related academic homework... I am trying to learn complexity as it is widely asked in interviews and I am just practicing it for common code I normally write.. I already did lot of google search before posting question here... And my question was more of a “yes” “no” type, as I already wrote my assumption on answer and just asked if its correct or not.. never asked for step by step answer! Also I saw article link you posted and didn’t find it relevant. If you still feel this question does not deserve answer then you can ignore it :)
Black Mamba Elapidae 8-May-22 9:58am View    
Deleted
My assumption is,
Time complexity o(n^2) : As filter will be o(n) and inside filter indexOf is used that’s another o(n) making total o(n^2)
But as filter and indexOf is on different arrays, should we say o(n*m) or o(n^2) is fine?
and space complexity o(n) -> as I assumed onlys space required is to store 2 arrays and function. Inside function nothing is stored its just returning results. Will it be right to say o(n) fir 2 arrays and one function?
Black Mamba Elapidae 14-Feb-16 23:20pm View    
I am not sure what are you suggesting with server push.. Please refer my comment on main thread ..
Black Mamba Elapidae 14-Feb-16 23:14pm View    
I know it is a bad idea . But as I mentioned already website B is not in my control and it is already designed to work in this way. this site B can be opened with HttpPost with some json data. user is supposed to select data in site B and it will send that data to site A (target url is already sent in initial request json)
Black Mamba Elapidae 12-Feb-16 5:50am View    
Thanks for quick response.
The website B I am mentioning is a courier website and they post the selected data on exposed url, that is how application B is calling action method of my application . :)