I know that, for a list, we have to traverse the entire list and then determine the size of it?
What is the complexity to determine the size of a binary in Erlang?
byte_size/1
(the command to measure binary stuff) executes in constant time irrelevant to the size of the binary, while length of a list is proportional to the size of the list.
See 3 Common Caveats for reference
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With