C Fundamentals
Algorithms · data structures · cryptography · systems — pure C11, zero deps
Loading...
Searching...
No Matches
selection_sort.c File Reference

Implementation of selection sort algorithm. More...

#include "sorts.h"
#include <string.h>

Go to the source code of this file.

Functions

size_t find_min_index (char **arr, size_t start, size_t n)
 
void selection_sort_ints (int *arr, size_t n)
 
void selection_sort_strings (char **arr, size_t n)
 

Detailed Description

Implementation of selection sort algorithm.

Selection sort works by repeatedly finding the minimum element from the unsorted portion and placing it at the beginning.

Definition in file selection_sort.c.

Function Documentation

◆ find_min_index()

size_t find_min_index ( char **  arr,
size_t  start,
size_t  n 
)

Definition at line 12 of file selection_sort.c.

Referenced by selection_sort_strings().

◆ selection_sort_ints()

void selection_sort_ints ( int *  arr,
size_t  n 
)

Definition at line 41 of file selection_sort.c.

◆ selection_sort_strings()

void selection_sort_strings ( char **  arr,
size_t  n 
)

Definition at line 24 of file selection_sort.c.

References find_min_index().

Referenced by algo_from_name(), and main().