Problem I am working my way through an algorithms course online, and the assignment is to implement Karatsuba’s multiplication algorithm. […]

# Category: Algorithm

## Computing huge Fibonacci numbers in Java

Problem I have this small Java program for computing particurly large Fibonacci numbers (10000th Fibonacci number is computed in about […]

## Random permutation with defined order of last occurrences

Problem This Python function takes two arguments: chr_list which is a mutable sequence of characters c chr_counts which maps to […]

## Algorithm to rotate array elements in Ruby

Problem I wrote this algorithm to rotate elements in an array. It’s not very efficient, but it works. It has […]

## BFT/DFT/Topological graph implementation

Problem I am trying to learn graphs and implement in code. Can you please review my code and give me […]

## Populate inorder successor for all nodes

Problem Given a binary tree where each node has following structure, write a function to populate next pointer for all […]

## All balanced parentheses for a given N

Problem Write a function (in Haskell) which makes a list of strings representing all of the ways you can balance […]

## Reverse chars of each word in a string

Problem An algorithm to reverse characters of each word in a sentence. What would be your concerns regarding the following […]

## Print tree level by level including Empty node

Problem Here is my code to print tree in a level by level way. It needs to print an empty […]

## Quicksort – follow-up

Problem This is a follow-up to Quicksort function Like the previous code, this does not optimize for containers with large […]