if it is integer, comparssions take O(1) ---------- due to a < b or b < a or a=b
if it is string with length 'n' , then comparission takes O(n) ------- due to you have to compare each letter in the strings in the worst case
ex:- "ABC", "ABD", how these two strings compared ( string length=3, in worst case it requires 3 comparissions )?
A == A, Proceed Further
B == B, Proceed Further
C ==D, not equal ===> as per lexograhical order, C < D ===> "ABC" < "ABD"