tgrekov-push_swap
HIVE push_swap July 2024
Loading...
Searching...
No Matches
get_minix.c
Go to the documentation of this file.
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* get_minix.c :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: tgrekov <tgrekov@student.hive.fi> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2024/07/16 10:22:38 by tgrekov #+# #+# */
9/* Updated: 2024/07/17 08:30:35 by tgrekov ### ########.fr */
10/* */
11/* ************************************************************************** */
12
27int get_minix(int *arr, int len)
28{
29 int minix;
30
31 len--;
32 minix = len;
33 while (len--)
34 {
35 if (arr[len] < arr[minix])
36 minix = len;
37 }
38 return (minix);
39}
int get_minix(int *arr, int len)
Get the index of the smallest element.
Definition get_minix.c:27