1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

double based number code help..

Discussion in 'C' started by ikj, May 18, 2009.

  1. ikj

    ikj New Member

    hi ppl!

    i would like to know how to use a binary search tree to find the optimal double base representation of a decimal number
    for eg with bases 2 n 3

    my algorithm to find the optimal double base representation of a number N using recursion is:
    step 1 : find the highest power combination, C, of 2 & 3 which is closest to N
    step 2 : subtract C from N to get a difference D
    step 3 : repeat step 1 with D inplace of N

    my question is how can i use a binary tree/binary search with this algoritm..
    i just need the theory(ie "funda") behind it...the code ill write myself..

    thanks for readin!

Share This Page