Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/trobert42/push_swap
Sorting numbers with two stacks in C
https://github.com/trobert42/push_swap
chained-list optimization-algorithms sorting-algorithms
Last synced: 9 days ago
JSON representation
Sorting numbers with two stacks in C
- Host: GitHub
- URL: https://github.com/trobert42/push_swap
- Owner: trobert42
- Created: 2023-08-31T20:40:22.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-24T12:20:30.000Z (9 months ago)
- Last Synced: 2024-02-24T19:50:36.405Z (9 months ago)
- Topics: chained-list, optimization-algorithms, sorting-algorithms
- Language: C
- Homepage:
- Size: 62.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sorting integers with two stacks
The Push_swap project involves sorting an array of integers using two stacks and a set of instructions. The goal is to create a program that sorts the integers received as arguments. This project aims to teach basic algorithms, complexity concepts, and C language programming. The instructions include writing code in C, adhering to coding norms and properly freeing heap-allocated memory space. The stacks 'a' and 'b' contain unique integers, and the task is to sort stack 'a' in ascending order using instructions such as sa, sb, ss, pa, pb, ra, rb, rra, and rrb, which swap, push, and rotate elements within the stacks.
| Project Name | push_swap |
| :----------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------: |
| Description | A sorting algorithm using stacks with a limited set of instrutions and using the lowest possible number of actions |
| Technologies | |
| External libraries | read(), write(), malloc(), free(), exit() |## Usage
```bash
gcl https://github.com/trobert42/push_swap.git
cd push_swap
make
./push_swap [list of numbers]
```## 💬
Big thanks to Nicolas for helping me understand the LIS (Longest Increasing Subsequence), on which i based my sorting code on it o/