-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix order stack_operations.h * fix module * fix performance test
- Loading branch information
Showing
33 changed files
with
62 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,15 +6,14 @@ | |
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/02/14 10:26:54 by reasuke #+# #+# */ | ||
/* Updated: 2024/02/19 12:11:08 by reasuke ### ########.fr */ | ||
/* Updated: 2024/02/20 14:19:45 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#ifndef CHECKER_H | ||
# define CHECKER_H | ||
|
||
# include "../libft/libft.h" | ||
# include "types.h" | ||
# include "push_swap.h" | ||
|
||
void sort_based_on_operation(t_stack **p_a, t_stack **p_b); | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/01/10 12:37:54 by reasuke #+# #+# */ | ||
/* Updated: 2024/02/13 12:45:48 by reasuke ### ########.fr */ | ||
/* Updated: 2024/02/20 14:19:53 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -21,9 +21,4 @@ | |
# include <stdlib.h> | ||
# include <unistd.h> | ||
|
||
int check_args(int argc, char **argv); | ||
t_stack *generate_stack(int argc, char **argv); | ||
|
||
void sort(t_stack **p_a, t_stack **p_b); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/02/11 12:41:01 by reasuke #+# #+# */ | ||
/* Updated: 2024/02/11 12:41:49 by reasuke ### ########.fr */ | ||
/* Updated: 2024/02/20 14:16:47 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -15,8 +15,17 @@ | |
|
||
# include "push_swap.h" | ||
|
||
void operate_sa(t_stack **p_a); | ||
void push_stack(t_stack **p_s1, t_stack **p_s2); | ||
void swap_stack(t_stack **p_stack); | ||
void rotate_stack(t_stack **p_stack); | ||
void reverse_rotate_stack(t_stack **p_stack); | ||
|
||
void do_single_n_operations(t_stack **p_st, int n, | ||
void (*operation)(t_stack **)); | ||
void do_double_n_operations(t_stack **p_a, t_stack **p_b, int n, | ||
void (*operation)(t_stack **, t_stack **)); | ||
|
||
void operate_sa(t_stack **p_a); | ||
void operate_sb(t_stack **p_b); | ||
void operate_ss(t_stack **p_a, t_stack **p_b); | ||
void operate_ra(t_stack **p_a); | ||
|
@@ -27,13 +36,5 @@ void operate_rrb(t_stack **p_a); | |
void operate_rrr(t_stack **p_a, t_stack **p_b); | ||
void operate_pa(t_stack **p_b, t_stack **p_a); | ||
void operate_pb(t_stack **p_a, t_stack **p_b); | ||
void do_single_n_operations(t_stack **p_st, int n, | ||
void (*operation)(t_stack **)); | ||
void do_double_n_operations(t_stack **p_a, t_stack **p_b, int n, | ||
void (*operation)(t_stack **, t_stack **)); | ||
|
||
void push_stack(t_stack **p_s1, t_stack **p_s2); | ||
void swap_stack(t_stack **p_stack); | ||
void rotate_stack(t_stack **p_stack); | ||
void reverse_rotate_stack(t_stack **p_stack); | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,12 +6,11 @@ | |
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/01/11 14:44:55 by reasuke #+# #+# */ | ||
/* Updated: 2024/02/19 12:56:30 by reasuke ### ########.fr */ | ||
/* Updated: 2024/02/20 14:19:12 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#include "initialization.h" | ||
#include "push_swap.h" | ||
|
||
static bool _has_not_digit(int argc, char **argv) | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,12 +6,11 @@ | |
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/01/11 14:38:17 by reasuke #+# #+# */ | ||
/* Updated: 2024/02/13 11:46:04 by reasuke ### ########.fr */ | ||
/* Updated: 2024/02/20 14:19:14 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#include "initialization.h" | ||
#include "push_swap.h" | ||
|
||
void exit_with_error(void) | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,12 +6,11 @@ | |
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/01/11 19:04:40 by reasuke #+# #+# */ | ||
/* Updated: 2024/02/14 14:28:39 by reasuke ### ########.fr */ | ||
/* Updated: 2024/02/20 14:19:17 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#include "initialization.h" | ||
#include "push_swap.h" | ||
|
||
int *_allocate_int_array(int size_a) | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,12 @@ | |
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/01/10 12:37:36 by reasuke #+# #+# */ | ||
/* Updated: 2024/02/19 12:06:15 by reasuke ### ########.fr */ | ||
/* Updated: 2024/02/20 14:21:01 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#include "push_swap.h" | ||
#include "initialization.h" | ||
#include "sort.h" | ||
|
||
#ifdef LEAK | ||
# ifdef __APPLE__ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,10 @@ | |
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/02/10 18:47:11 by reasuke #+# #+# */ | ||
/* Updated: 2024/02/13 14:01:58 by reasuke ### ########.fr */ | ||
/* Updated: 2024/02/20 14:18:06 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#include "push_swap.h" | ||
#include "sort.h" | ||
|
||
bool is_sorted_stack(t_stack *st) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,12 +6,11 @@ | |
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/02/10 10:43:16 by reasuke #+# #+# */ | ||
/* Updated: 2024/02/14 16:40:21 by reasuke ### ########.fr */ | ||
/* Updated: 2024/02/20 14:17:27 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#include "large_sort.h" | ||
#include "push_swap.h" | ||
#include "stack_operations.h" | ||
|
||
static t_stack *_find_opt_st_b(t_stack **p_b) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,12 +6,11 @@ | |
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/01/22 16:55:10 by reasuke #+# #+# */ | ||
/* Updated: 2024/02/15 12:34:14 by reasuke ### ########.fr */ | ||
/* Updated: 2024/02/20 14:17:35 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#include "large_sort.h" | ||
#include "push_swap.h" | ||
#include "sort.h" | ||
#include "stack_operations.h" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,12 +6,11 @@ | |
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/02/11 22:57:28 by reasuke #+# #+# */ | ||
/* Updated: 2024/02/14 14:31:29 by reasuke ### ########.fr */ | ||
/* Updated: 2024/02/20 14:17:46 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#include "large_sort.h" | ||
#include "push_swap.h" | ||
#include "stack_operations.h" | ||
|
||
static int _calc_segment_id(int target, int n, int segs) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,12 +6,11 @@ | |
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/02/08 12:17:33 by reasuke #+# #+# */ | ||
/* Updated: 2024/02/14 14:15:57 by reasuke ### ########.fr */ | ||
/* Updated: 2024/02/20 14:17:50 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#include "large_sort.h" | ||
#include "push_swap.h" | ||
|
||
static int _calc_insertion_threshold(t_stack **p_a, t_stack *st_b) | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,12 +6,11 @@ | |
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/02/14 14:44:38 by reasuke #+# #+# */ | ||
/* Updated: 2024/02/14 16:42:11 by reasuke ### ########.fr */ | ||
/* Updated: 2024/02/20 14:17:53 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#include "large_sort.h" | ||
#include "push_swap.h" | ||
|
||
static int _calc_max_segment(t_stack *st_b) | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,12 +6,11 @@ | |
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/02/09 10:23:28 by reasuke #+# #+# */ | ||
/* Updated: 2024/02/14 15:44:15 by reasuke ### ########.fr */ | ||
/* Updated: 2024/02/20 14:18:02 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#include "large_sort.h" | ||
#include "push_swap.h" | ||
|
||
static int _calc_cost(t_stack *st_b, t_method method) | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,10 @@ | |
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/01/15 16:32:27 by reasuke #+# #+# */ | ||
/* Updated: 2024/02/13 15:38:56 by reasuke ### ########.fr */ | ||
/* Updated: 2024/02/20 14:18:10 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#include "push_swap.h" | ||
#include "sort.h" | ||
#include "stack_operations.h" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,10 @@ | |
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/01/12 15:58:22 by reasuke #+# #+# */ | ||
/* Updated: 2024/02/11 12:54:19 by reasuke ### ########.fr */ | ||
/* Updated: 2024/02/20 14:18:22 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#include "push_swap.h" | ||
#include "sort.h" | ||
#include "stack_operations.h" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,10 @@ | |
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/01/15 15:10:35 by reasuke #+# #+# */ | ||
/* Updated: 2024/02/11 12:54:21 by reasuke ### ########.fr */ | ||
/* Updated: 2024/02/20 14:18:25 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#include "push_swap.h" | ||
#include "sort.h" | ||
|
||
void sort(t_stack **p_a, t_stack **p_b) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,11 @@ | |
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/02/10 19:22:50 by reasuke #+# #+# */ | ||
/* Updated: 2024/02/10 19:29:43 by reasuke ### ########.fr */ | ||
/* Updated: 2024/02/20 14:15:32 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#include "push_swap.h" | ||
#include "stack_operations.h" | ||
|
||
void do_double_n_operations(t_stack **p_a, t_stack **p_b, int n, | ||
void (*operation)(t_stack **, t_stack **)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,11 @@ | |
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/02/10 19:22:26 by reasuke #+# #+# */ | ||
/* Updated: 2024/02/10 19:29:08 by reasuke ### ########.fr */ | ||
/* Updated: 2024/02/20 14:15:35 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#include "push_swap.h" | ||
#include "stack_operations.h" | ||
|
||
void do_single_n_operations(t_stack **p_st, int n, | ||
void (*operation)(t_stack **)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,11 @@ | |
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/01/15 15:56:53 by reasuke #+# #+# */ | ||
/* Updated: 2024/02/07 15:05:10 by reasuke ### ########.fr */ | ||
/* Updated: 2024/02/20 14:15:37 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#include "push_swap.h" | ||
#include "stack_operations.h" | ||
|
||
void push_stack(t_stack **p_s1, t_stack **p_s2) | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,11 @@ | |
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/01/23 17:18:15 by reasuke #+# #+# */ | ||
/* Updated: 2024/02/07 15:04:58 by reasuke ### ########.fr */ | ||
/* Updated: 2024/02/20 14:15:40 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#include "push_swap.h" | ||
#include "stack_operations.h" | ||
|
||
void reverse_rotate_stack(t_stack **p_stack) | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,11 @@ | |
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/01/15 14:05:46 by reasuke #+# #+# */ | ||
/* Updated: 2024/02/07 15:05:17 by reasuke ### ########.fr */ | ||
/* Updated: 2024/02/20 14:15:43 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#include "push_swap.h" | ||
#include "stack_operations.h" | ||
|
||
void rotate_stack(t_stack **p_stack) | ||
{ | ||
|
Oops, something went wrong.