All Stories

Tree data structure: Binary Search Tree

Tree data structures are non-linear data structures, and they allow us to implement algorithms much faster than when using linear data structures.

Combinational Optimization Problem

The Knapsack problem is a classic optimization problem in computer science and mathematics. It belongs to a class of problems known as combinatorial optimization problems. The basic idea of the...

Given N, find the smallest number with the same digits

Write a method that, given an original number N, returns the smallest number with the same number of digits.