Git Product home page Git Product logo

gens's Introduction

genS

C

Objective

The project aims to implement a high level algorithm that has the function of ordering files that do not fit into the main memory of the computer. Therefore, it is necessary to use an external sorting algorithm to store the files in auxiliary memory. To sort a given data file as input, the sorting method to use will be Merge-Sort, and the strategy will be to combine multiple ordered file units into a single sorted file block (merge).

dev

  1. The C language was used for implementation.
  2. Used libraries: stdlib.h, stdio.h, stdint.h, math.h, string.h, unistd.h e time.h.
  3. Data structure: Stack.

Complexity

  • The height of the execution tree can be defined by O (log n)..
  • The number of operations at each level of the execution tree is defined by O (n).
  • Therefore, the complexity of the algorithm for any case is O (n log n).

How to compile and run

The process is the simple way to compile C files using gcc.

To facilitate typing, the project has the Makefile to execute the command for you.

To use it just type ** make ** on your terminal at the file location. Then choose the one you want to run first:

  1. Generate a random number file
  2. Sort values within a file

To generate a file, run:

./gerarArquivo primeiroPARAMETRO segundoPARAMETRO

First parameter is the name of the file, and the second is the SIZE IN MB

To sort execute:

./msort primeiroPARAMETRO segundoPARAMETRO terceiroPARAMETRO quartoPARAMETRO

First parameter is the ** filename ** that you want to sort, second is the ** output name **, third the total amount of ** memory ** available for sorting, and the fourth the ** K ** (number of routes used by Merge-sort).

Experiments

Generating a 6GB file

It lasted an average time of 64.4198s.

PC 4GB de RAM, i3.

gens's People

Contributors

rv-vmartins avatar

Stargazers

 avatar  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.