when you enter into Datastructure you first see Complexity of an algorithm , O(1), O(n), O(log n), O(n log n) and O(n2).
I see
O(1) is constant complexity, therefore when you access a Property inside a class right ?
ex: List<T> class Count property
O(n) - complexity is number of items in the collection
ex: for loop the collection
but I could not understand O(log n) and O(n log n), O(n2) could you please give me a clear explation about those ?
NOTE: I found BinaryTree<T> contains method has O(log n) complexity but how ?