Nearly there !!!

WIP merge sort
still problems with negative numbers
This commit is contained in:
Tanguy MAZE
2019-03-06 12:12:00 +01:00
parent ac9b03acff
commit 428525b561
6 changed files with 114 additions and 36 deletions

View File

@@ -6,16 +6,17 @@
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/02/21 15:59:46 by tmaze #+# #+# */
/* Updated: 2019/02/23 15:45:30 by tmaze ### ########.fr */
/* Updated: 2019/03/06 11:36:38 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
void ps_push(t_psdata *data, char c)
int ps_push(t_psdata *data, char c)
{
t_stack *tmp;
tmp = ps_stkpop(data, (c == 'a') ? c : 'b');
ps_stkpsh(data, c, tmp);
if ((tmp = ps_stkpop(data, (c == 'a') ? 'b' : 'a')) != NULL)
ps_stkpsh(data, c, tmp);
return (tmp != NULL);
}