Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Slurping a file



On Sun, Jan 14, 2024 at 4:37 PM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>
> On 2024-01-14 02:34, Roman Perepelitsa wrote:
>
> > Indeed, this would be faster but the code would still have quadratic time complexity. Here's a version with linear time complexity:
>
> Quadratic? In this kind of situation I'd understand linear, geometric and exponential. What's quadratic?

O(n^2) where n is the file size.

> main[hilighted]= # Don't even think about doing this!
>
> ... I've noticed that if initializing an A array, there *must* be a value otherwise the pairs go out of whack.

You must be using `print $main` to see what's going on. Use a better tool.

Roman.




Messages sorted by: Reverse Date, Date, Thread, Author