• Ananace@lemmy.ananace.dev
    link
    fedilink
    arrow-up
    14
    ·
    2 年前

    If you build a linked list in C, and put the pointer to the next entry as the first element in your struct, then you only need a single variable (and two comparisons) to do sorted insertion into the list.