File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
program/c/src/oracle/model Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 22#include "../util/avg.h" /* For avg_2_int64 */
33
44/*
5- * In-place Heapsort implementation optimized for minimal compute unit usage in BPF.
5+ * In-place bottom-up Heapsort implementation optimized for minimal compute unit usage in BPF.
66 *
77 * Initially it creates a max heap in linear time and then to get ascending
88 * order it swaps the root with the last element and then sifts down the root.
99 *
10+ * The number of comparisions in average case is nlgn + O(1) and in worst case is
11+ * 1.5nlgn + O(n).
12+ *
1013 * There are a lot of (j-1) or (j+1) math in the code which can be optimized by
1114 * thinking of a as 1-based array. Fortunately, BPF compiler optimizes that for us.
1215 */
You can’t perform that action at this time.
0 commit comments