I'm going through some programming interview question books, and I've seen reference to "O(|A|)"
time complexity. I've never seen this notation with the absolute value given.
Some research led me to Big O Cheatsheet that references this notation under the graphs section. The problem I'm researching is about partitioning an array, which isn't really a graph question (though I risk perhaps showing my ignorance with that statement).
Does |A|
refer to the magnitude of the array, or otherwise number of elements, i.e. O(N)
?
In set theory notation
|A|
is the cardinality of setA
, in other words the number of elements contained in setA
.For Reference: http://www.mathsisfun.com/sets/symbols.html