Thirty seconds over Ternary Search tree

Wow! It’s been another week from the time when I wrote the previous article about grokking algorithms. The time is passing so fast I barely can see it! Today I want to introduce a new concept to you - Ternary Search Tree (aka TST). You may already have heard about Binary Search Tree (aka BST) and this idea is pretty similar. Don’t worry if you did not hear about BST or any trees at all before, TST is pretty easy to understand and you will quickly nail it!...

February 2, 2022 · 6 min · 1091 words · Me

Solving Leetcode: #141 Linked List Cycle

Yo-yo Wow, another week has passed since the previous Solving Leetcode #1345 article. Today we are going to solve [#141 Linked List Cycle](https://leetcode.com/problems/linked-list-cycle/ problem). Let’s start from the statement: Given head, the head of a linked list, determine if the linked list has a cycle in it. There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer....

January 30, 2022 · 4 min · 757 words · Me

Blur, blur, and one more time blur

Did you ever think what is blur exactly? Generally, the blur means something unclear or something that is hard to see. We can see blur (as an effect) everywhere: you can see the similar effect looking through frosted glass, or just looking on the street through a window in a raining day drinking coffee and feeling blue just for nothing. You can also see blur in so many applications and video games....

January 26, 2022 · 11 min · 2200 words · Me

Solving Leetcode: #1345 Jump Game IV

Have you missed me? Yeah, me too and I am happy to be back again with a new article! Lately I did a thing and pretty glad to introduce a new have non-periodical column at our website! During these small sessions we are going to solve and explain the problems from Leetcode. Sounds exciting, right? So this time the problem is #1345. Jump Game IV. Let me also to copy the problem statement here....

January 23, 2022 · 4 min · 847 words · Me

A fish called Fenwick tree

You may wonder, “Fenwick what? Which tree???”. Don’t be afraid of the spooky term the idea is pretty innocent. Remember: fear is the path to the dark side. First of all, let’s start with a simple problem: Imagine you have an array a of integers of length n. For the sake of simplicity let’s assume it is a one-dimensional array. You are given 2 values start and finish and your goal is to find a sum of all elements in this array between start and finish....

January 19, 2022 · 13 min · 2686 words · Me