Skip to content

chnrxn/algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

algorithms

median.py

Finds the median value of an array of numbers using binary tree insertion sort.

The insertion and flattening the tree into a list are straightforward enough using recursion, but finding the median within the binary tree, especially for an even number of items, proved to be much more difficult.

Obtaining the middle values from a list retrieved from the binary tree seems trivial enough, but I took the challenge to find the middle values within the tree itself.

On hindsight, obtaining the median from the list is much easier and more desirable. Neighbour lookup inside a tree structure is fraught with difficulties.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages