Giter Site home page Giter Site logo

winner-tree's Introduction

Winner-Tree

Use Winner Tree to complete the part of merge of external sort.

Why we need external sort?

When we try to sort some file, we can load all of them and sort if memory is enough. It's called internal sort. But if memory is not enough to load all the data, we need to sort with the disk.

Ideas

If the number of files is 2n, they can compose full binary tree. It is ok to merge all of them at same time. But when the number of files that we want to merge is not 2n, It may be some problem there.

I try to use three method to complete my Winner Tree merge. The details is introduced below.

Ideas 1 - merge max 2n <= number of files

Merge the max 2n but less or equal the number of files at one time. Take an example, if we have 9 files to merge, I merge 8 files at first, and merge 2 file at second.

Ideas 2 - merge min 2n >= number of files

Ideas 3 - merge files = number of files

coming soon~

winner-tree's People

Contributors

jinghanzhan avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.