Giter Club home page Giter Club logo

ft_push_swap_42's Introduction

Push_Swap42

Ordering a Stack with limited operations available.

Push_swap

This project focuses on data sorting on a stack using a limited set of instructions, aiming to achieve the sort with the minimum possible number of operations.

Table of Contents

  1. Introduction
  2. Objectives
  3. Common Instructions
  4. Mandatory Part
  5. Bonus Part

Introduction

Push swap project focuses on creating a simple, straightforward sorting algorithm that uses two stacks and a set of instructions to manipulate both stacks. The primary goal is to write a program in C called push_swap, which calculates and displays the smallest program, composed of push_swap language instructions, to sort the integers received as arguments.

Objectives

Writing a sorting algorithm is a critical step for a developer as it introduces the concept of complexity. The key learning objectives of this project are rigor, the use of C, and the application of basic algorithms with a focus on complexity.

Common Instructions

  • Project must be written in C.
  • It should comply with the Norm.
  • It should not quit unexpectedly (segmentation fault, bus error, double free, etc).
  • All heap allocated memory space must be properly freed when necessary.
  • Submission must include a Makefile to compile source files to the required output.
  • If the project allows libft, its sources and associated Makefile should be copied in a libft folder.

Mandatory Part

The project involves two stacks named a and b, and a set of instructions to manipulate both stacks.

The goal is to sort the integers into stack a in ascending order using operations like swap, push, rotate and reverse rotate.

The program named push_swap should take stack a as a list of integers and display the smallest list of instructions possible to sort the stack.

Bonus Part

Create a checker program to verify whether the list of instructions generated by the push_swap program actually sorts the stack properly.

The checker program takes stack a as a list of integers, waits and reads instructions on the standard input, and executes them on the stack.

If the stack a is sorted after executing the instructions and stack b is empty, the checker should display "OK". In any other case, it should display "KO".

ft_push_swap_42's People

Contributors

thejocker94 avatar

Stargazers

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