From 3a61b225cfde28bba2594f71cea2ec9e26491a00 Mon Sep 17 00:00:00 2001 From: suggxem Date: Tue, 16 Jun 2026 05:59:59 +0300 Subject: [PATCH] New Function cf2 --- greedy_approach/dijkstra.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/greedy_approach/dijkstra.c b/greedy_approach/dijkstra.c index e9d1c63ca8..92f19f7707 100644 --- a/greedy_approach/dijkstra.c +++ b/greedy_approach/dijkstra.c @@ -21,6 +21,14 @@ int cf(void *a, void *b) return *y - *x; } +int cf2(void *a, void *b) +{ + int *x = (int *)a; + int *y = (int *)b; + return dist[*y] - dist[*x]; +} + + int dequeue() { qsort(q, qp, sizeof(int), cf);