What is the time complexity of reversing a word using stack algorithm?

Q & ACategory: Data StructureWhat is the time complexity of reversing a word using stack algorithm?
Admin Staff asked 4 years ago

What is the time complexity of reversing a word using stack algorithm?
a) O (N log N)
b) O (N2)
c) O (N)
d) O (M log N)

1 Answers
Admin Staff answered 4 years ago

c) O (N)