Giter Club home page Giter Club logo

two-phase-merge-sort's Introduction

Two-Phase-Merge-Sort

Implementation of External Sort. Details can be referred from README.

Implementation of two phase merge sort algorithm to sort large number of records with the specifications mentioned below :

  1. Metadata information: a. This information will be provided in a file as an input to algorithm and will contain the information about the columns and their data type. b. The number of columns can vary from 1 to 20. c. The data type for the column can be String, Integer or Date. i. Date: It will be represent by date. e.g. col1,date or mycol,date etc. ii. String:It will be represented by char() i.e. every string will be of same size defined by e.g. cols,char(10) or column,char(11) etc. iii. Integer: e.g. It will be represented by int. col1,int or mycol,int etc.

  2. Input Data: a. Each record will start from newline. b. Column values will be separated by comma. c. String will comprise of alphanumeric characters only i.e. A-Z a-z 0-9 d. Date will be in the format DD/MM/YYYY format.

  3. Output Data: a. Output file will contain the columns that you have specified as an argument to your algorithm. So, the number of columns can differ in output file as compared to input file. b. Each record will be separated by new line and column values by comma(similar to input data format).

  4. Main memory: a. The main memory that is allowed to use will be specified by command line argument. b. Checked if the two phase merge sort is feasible or not in the provided memory as argument. If not, proper error message is generated. c. For C/C++, use the dynamic memory allocation malloc and request 80% of the main memory specified in MB from the underlying OS and use the same memory for sorting. d. For Java, use the argument -Xmx to restrict the heap size equal to 10 times memory specified in MB.

  5. Sorting columns: a. If the sorting needs to be done using multiple columns then if the values of the first column is same,sorting on the basis of the second column and so on is done. b. If the value of all the columns mentioned for sorting is same, for such records the order in the output should be maintained as the order in the input file.

two-phase-merge-sort's People

Contributors

harshjain27 avatar

Watchers

 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.