DEV Community

Discussion on: Trees and the Database.

 
dwakelknight profile image
♠ รєใ๏г๓ คv๏кє †

Oh okay, so that means like nothing will really change in time complexity as opposed to running two different for loops from the opposite ends of the array; the only difference will be in space complexity of the variables that hold the arr.index if either situation, I variable in the first (new implementation) and 2 variables in using traditional method of two loops