-
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.
- Loading branch information
Showing
8 changed files
with
32 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/02/11 12:36:38 by reasuke #+# #+# */ | ||
/* Updated: 2024/02/14 14:44:13 by reasuke ### ########.fr */ | ||
/* Updated: 2024/02/14 16:41:29 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -19,7 +19,7 @@ void large_sort(t_stack **p_a, t_stack **p_b); | |
void push_b_segmented(t_stack **p_a, t_stack **p_b, int n, int num_seg); | ||
void set_cost(t_stack **p_a, t_stack **p_b); | ||
void set_min_cost_opt_method(t_stack **p_b); | ||
void set_is_opt(t_stack **p_b); | ||
void set_is_target(t_stack **p_b); | ||
void greedy_operation(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:57:41 by reasuke #+# #+# */ | ||
/* Updated: 2024/02/14 14:24:17 by reasuke ### ########.fr */ | ||
/* Updated: 2024/02/14 16:40:21 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -34,6 +34,6 @@ typedef struct s_content | |
int rra_cost; | ||
int min_cost; | ||
t_method opt_method; | ||
bool is_opt; | ||
bool is_target; | ||
} t_content; | ||
#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/10 10:43:16 by reasuke #+# #+# */ | ||
/* Updated: 2024/02/14 14:20:41 by reasuke ### ########.fr */ | ||
/* Updated: 2024/02/14 16:40:21 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -19,7 +19,7 @@ static t_stack *_find_opt_st_b(t_stack **p_b) | |
t_stack *st_b; | ||
|
||
st_b = *p_b; | ||
while (!get_content(st_b)->is_opt) | ||
while (!get_content(st_b)->is_target) | ||
st_b = st_b->next; | ||
return (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,7 +6,7 @@ | |
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/01/22 16:55:10 by reasuke #+# #+# */ | ||
/* Updated: 2024/02/14 14:45:15 by reasuke ### ########.fr */ | ||
/* Updated: 2024/02/14 16:41:29 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -59,7 +59,7 @@ void large_sort(t_stack **p_a, t_stack **p_b) | |
{ | ||
set_cost(p_a, p_b); | ||
set_min_cost_opt_method(p_b); | ||
set_is_opt(p_b); | ||
set_is_target(p_b); | ||
greedy_operation(p_a, p_b); | ||
} | ||
_sort_stack_a(p_a, 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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
/* ************************************************************************** */ | ||
/* */ | ||
/* ::: :::::::: */ | ||
/* set_is_opt.c :+: :+: :+: */ | ||
/* set_is_target.c :+: :+: :+: */ | ||
/* +:+ +:+ +:+ */ | ||
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/02/14 14:44:38 by reasuke #+# #+# */ | ||
/* Updated: 2024/02/14 16:22:59 by reasuke ### ########.fr */ | ||
/* Updated: 2024/02/14 16:42:11 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -46,7 +46,7 @@ static int _calc_target_index(t_stack *st_b, int max_seg) | |
return (target_index); | ||
} | ||
|
||
void set_is_opt(t_stack **p_b) | ||
void set_is_target(t_stack **p_b) | ||
{ | ||
int i; | ||
t_stack *st_b; | ||
|
@@ -59,5 +59,5 @@ void set_is_opt(t_stack **p_b) | |
i = 0; | ||
while (i++ < target_index) | ||
st_b = st_b->next; | ||
get_content(st_b)->is_opt = true; | ||
get_content(st_b)->is_target = true; | ||
} |
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