Author Archives: Stanislav_Panteleev

Algo.Java.BFS.In.Matrix

here is the illustration, step by step code:

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

Java.Algo.Kadane.MaxSumOfSubArray

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

Algo.Java.GetBitFromInteger

LSB – least significant beat, most right bit MSB – most significant bit, most left bit code below shows if there is a bit in k position from leeast significant bit

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

Algo.Java.BinarySearch.BrilliantProblem

// this is one of the brilliant problems of binary search on leetCode, the main idea to realize that fractions are in [0, 1) range As usually g function here is the function which for values >= mid returns true, … Continue reading

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

Algo.Java.StringTips

// convert chart to int isPalindrome

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

Algo.Java.LoopSpeed

Interesting observation ! looking at leetcode tests with different algos, looks like for in with iterator inside works faster than for i

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

Algo.Java.Arrays.AnotherExampleOfFrequencyApproach

another example

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

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 Без рубрики | Comments Off on Algo.Java.BitmaskForEvens

Algo.Java.MonotonicStack

Example

Posted in Без рубрики | Comments Off on Algo.Java.MonotonicStack

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 Без рубрики | Comments Off on Java.Algo.Arrays.SeparateDigits