question about a data structure
29 Jul
2009
29 Jul
'09
4:36 p.m.
Hello, Suppose I want to store some data (a non-negative integer) related to an "event" involving two entities. It occurs to me that the way to do it is using a 2-d array, like a table: For example: a b c a 1 b 2 0 c 5 in the event 'b-a' the data is 2, and in the event 'c-a' is 5, etc. Now, I need to be able to differentiate between 0 and 'no data'. I know I could use a number like -1, but this would affect arithmetic operations on the array, and also I need that indexing one such location with no data returns an empty array. Is it possible to do this with the standard array class? Thanks. Ernest
5355
Age (days ago)
5356
Last active (days ago)
3 comments
3 participants
participants (3)
-
Christopher Barker
-
Ernest Adrogué
-
Robert Kern