coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: numfmt enhancements to emulate df -g


From: Dylan Cali
Subject: Re: numfmt enhancements to emulate df -g
Date: Fri, 19 Jun 2015 22:57:01 -0400

On Fri, Jun 19, 2015 at 3:08 PM, Pádraig Brady <address@hidden> wrote:
> Dylan I used/adjusted your patch for multiple fields support.

Thanks Pádraig, excited to see this making its way into the mainline.

> Note I moved from an avltree to a linked list so that memory
> consumption was proportional to the number of field specifications,
> rather than the number of fields specified.

Can't you store field specifications as the elements in an avl tree as
well, without having to resort to something fancy like an interval
tree?  And if it's the same number of elements, shouldn't memory
consumption be the same as with a linked list since they're both node
based structures?

I went with the avl tree just because theoretically if someone were to
list duplicate, out of order fields (or field specs) inserting them is
going to be O(n) with a sorted linked list vs O(logn) with a binary
search tree.  Obviously for such a small cli tool it doesn't really
matter though.

I trust your judgment, just curious for my own edification.

Thanks,
Dylan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]