/push_swap

Push_Swap - Efficient Sorting with Stack Operations πŸ”„πŸ“Š

Primary LanguageC

Push_Swap - Efficient Sorting with Stack Operations πŸ”„πŸ“Š

Image 1 Image 2 Image 3

Project Overview πŸ“‹

This repository houses my push_swap project, a complex algorithmic challenge designed to sort stacks using a pre-defined set of operations efficiently. This project served as a personal deep dive into algorithmic complexity and C programming, with a keen focus on creating a sorting algorithm that’s not just correct, but optimized for performance.

-Double Stack Manipulation πŸ”„: Utilizing two stacks, a and b, the exercise involves sorting a random series of numbers in ascending order on stack a, employing only the allowed operations.

-Operations Set πŸ› οΈ: The allowed operations, such as sa, pa, rra, etc., offer a limited yet powerful toolkit for manipulating stack contents.

-Optimization Challenge πŸš€: The core of the project is to transform an unsorted stack into a sorted one using the fewest possible operations, showcasing my grasp of algorithmic efficiency.

Technical Execution πŸ”§

-Coding Standards πŸ“œ: Adherence to the Norm coding standards is a guarantee, ensuring clean and readable C code throughout the project.

-Robust Error Handling ⚠️: Every questionable scenario is met with clear error messaging, preventing undefined behaviors and protecting against common issues like segmentation faults.

-Memory Management 🧠: Dynamic memory allocation is handled meticulously, with every byte of heap memory being accounted for and freed appropriately to avoid leaks.

Algorithmic Strategy 🧩

-Longest Sorted Subsequence Approach πŸ“ˆ: My implementation leverages the concept of finding the longest sorted subsequence within the unsorted stack to minimize operations required for full stack sorting.

Project Conclusion πŸŽ“

The β€œpush_swap” project is a testament to my capabilities in computational thinking and coding discipline. Coincidentally, it serves as a comprehensive example of advanced C programming and sorting algorithms, crucial for both academic understanding and technical interviews. πŸš€πŸ‘©β€πŸ’»