feat(divide-and-conquer): Add binary exponentiation algorithm - #14
Open
dcq-31 wants to merge 1 commit into
Open
Conversation
|
@dcq-31 is attempting to deploy a commit to the midudev pro Team on Vercel. A member of the Team first needs to authorize it. |
dcq-31
force-pushed
the
feat/add-binary-exponentiation
branch
from
August 2, 2026 02:35
400532d to
492d798
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Binary Exponentiation algorithm to Divide and Conquer category
Summary
Adds Binary Exponentiation — the classic O(log n) fast-power algorithm — to the existing Divide and Conquer / Divide y vencerás category, which previously contained only Tower of Hanoi. Computes
aⁿby halving the exponent at each recursive step, visualized through the call stack concept so the logarithmic recursion depth is immediately visible.This version is adapted to the current
mainarchitecture instead of the original older branch layout. The algorithm is wired through the catalog, dynamic loaders, localized content files, and per-language implementation packs so it works with the current app structure.Changes
src/lib/algorithms/divide-and-conquer.tsaddsbinaryExponentiationusing the concept / callStack visualization and bilingual step descriptions viad().src/lib/algorithms/index.tsimports and registers the algorithm under the existingDivide and Conquercategory.src/lib/algorithms/catalog.tsandsrc/lib/algorithms/loaders.tsregister the newbinary-exponentiationid so routes, on-demand loading, and code pages resolve correctly.src/content/algorithms/binary-exponentiation.tsadds English and Spanish long-form descriptions using the current content system.binary-exponentiation.README.mdandREADME_ES.md. Also adds the previously omitted Bucket Sort entry to the Sorting / Ordenamiento sections — Bucket Sort was already implemented and registered but had not been listed in the READMEs.Visualization
Trace of
binPow(2, 10) = 1024shown as an animated call stack:10 → 5 → 2 → 1 → 0), showing the stack grow one frame at a time.binPow(2, 0): returns1.half × half) or the odd-exponent case (half × half × base).2¹⁰ = 1024, demonstrating logarithmic recursion depth instead of linear repeated multiplication.The same trace shows both cases naturally:
binPow(2, 2)andbinPow(2, 10)binPow(2, 1)andbinPow(2, 5)