T
Travis
So here's something I've been working on (professionally not academic)
that has puzzled me.
Given an array (say of ints or bytes if easier to think about), the
begginning of the array tells you the overall length and each index in
the array is formatted as follows:
first byte: length
second / third byte: unique id
optional: data
Also keep in mind this array is never sorted in anyway. So to find a
specific unique ID, I'm forced to traverse the entire thing until I
find it.
What I'm curious about is if there's a more efficient way to do this.
Any STL mechanisms that might make this less expensive. Something that
can tokenize the array or something like (given that i know the status
ID I'm looking for).
What do you think?
that has puzzled me.
Given an array (say of ints or bytes if easier to think about), the
begginning of the array tells you the overall length and each index in
the array is formatted as follows:
first byte: length
second / third byte: unique id
optional: data
Also keep in mind this array is never sorted in anyway. So to find a
specific unique ID, I'm forced to traverse the entire thing until I
find it.
What I'm curious about is if there's a more efficient way to do this.
Any STL mechanisms that might make this less expensive. Something that
can tokenize the array or something like (given that i know the status
ID I'm looking for).
What do you think?