Attempted to separate the snippets of code to small functions and each set of functions have its own file. Also made some improvements by using pools instead of constantly mallocing space.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
#ifndef BFS_H
|
||||
#define BFS_H
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
/**
|
||||
* @brief Runs a BFS to find the minimum moves to reach a triplet with zero
|
||||
* @param sum Pointer to store the sum of moves for the found solution
|
||||
* @param a0 The initial value of a
|
||||
* @param b0 The initial value of b
|
||||
* @param c0 The initial value of c
|
||||
* @param print_mode The mode for printing the results (1 for full, 2 for minimal)
|
||||
* @return 1 if a solution is found, 0 otherwise
|
||||
*/
|
||||
int run_bfs(int128_t* sum, int128_t a0, int128_t b0, int128_t c0, int print_mode);
|
||||
|
||||
#endif /* BFS_H */
|
||||
Reference in New Issue
Block a user