Git Product home page Git Product logo

push_swap's Introduction

push_swap

Sorting data on a stack, with a limited set of instructions, using the lowest possible number of actions. To succeed I’ll have to manipulate various types of algorithms and choose the most appropriate solution (out of many) for an optimized data sorting. ush_swap is a program written in C that takes a list of integers as input and performs a series of operations on them to sort them in ascending order. The program is designed to work with a set of two stacks, referred to as stack A and stack B. The goal of the program is to sort the list of integers using only the following operations:

sa: swap the top two elements of stack A sb: swap the top two elements of stack B ss: swap the top two elements of both stack A and stack B pa: take the top element of stack B and push it onto stack A pb: take the top element of stack A and push it onto stack B ra: rotate stack A upwards (move the top element to the bottom of the stack) rb: rotate stack B upwards (move the top element to the bottom of the stack) rr: rotate both stack A and stack B upwards rra: rotate stack A downwards (move the bottom element to the top of the stack) rrb: rotate stack B downwards (move the bottom element to the top of the stack) rrr: rotate both stack A and stack B downwards The program is designed to minimize the number of operations required to sort the list of integers. It does this by using various sorting algorithms and techniques to efficiently rearrange the elements in the stacks. The program includes a visualizer tool that allows you to see the state of the stacks as the sorting algorithms are being applied.

push_swap's People

Contributors

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