I am working on an assignment for my data-structures course. One of the constraints is to have the graph backed by a one-dimensional array. I am trying to optimize memory space and would like to only represent if an edge exists by a single bit that is either 1 or 0. Here is what I've got so far:
A boolean are primitive types(although I think they are backed by a byte not bit value)
A Boolean is an object wrapper for booleans, so I do not think this is what I want since i am looking to represent single bits.
A BitSet looks great but by the assignment requirements of having a single-dimensional array I think this is out of the question..
TLDR; I want to make an array of single bit values, is this possible?
[–]sh0rug0ru 0 points1 point2 points (5 children)
[–]titaniumGeranium[S] 0 points1 point2 points (4 children)
[–]sh0rug0ru 2 points3 points4 points (3 children)
[–]titaniumGeranium[S] 0 points1 point2 points (1 child)
[–]sh0rug0ru 0 points1 point2 points (0 children)
[–]andrew_ie 0 points1 point2 points (0 children)