Category Archives: Без рубрики

Algo.Java.BitmaskForEvens

To Everyone using nums[ i ] % 2 == 0 to check for even element. Use bitmask to determine even numbers which is fast computation wise.( nums[ i ] & 0x1 ) == 0 instead of nums[ i ] % 2 == 0

Posted in Без рубрики | Leave a comment

Algo.Java.MonotonicStack

Example

Posted in Без рубрики | Leave a comment

Java.Algo.Arrays.SeparateDigits

We can convert integer to string and then get chars, but more effective way is to use / and % operators, here is an example more effective example

Posted in Без рубрики | Leave a comment

Algo.Java.Arrays.Intersection

example another example

Posted in Без рубрики | Leave a comment

Algo.Java.Arrays.PriorityQueue

example

Posted in Без рубрики | Leave a comment

Algo.Java.DFS.BST.CollectNodesByDepth

example

Posted in Без рубрики | Leave a comment

Algo.Java.GetAllSubArrays

iterative approach recursive approach

Posted in Без рубрики | Leave a comment

Algo.Java.Dfs.Backtracking

ALL SUBSETS IS NOT ALL SUBARRAYS !!! Lets say we have array with nums 5 1 6, what will be all combinations of these nums ? It’s a tree, so we can traverse it and get all combinations, where we … Continue reading

Posted in Без рубрики | Leave a comment

Algo.Java.IsSameTree

Posted in Без рубрики | Leave a comment

Algo.Java.DFS.Postorder

find sum find count find max abs difference between left and right find max diameter between left and right

Posted in Без рубрики | Leave a comment