1). Which of the following statements about the operations of a stack is correct?
a). Both pop and push take O(1) time.
b). The speed of pop and push depends on the stack size.
c). Push is faster than pop.
d). Pop is faster than push.
2). For a singly linked list with n nodes to find and remove a node from the list takes how long?
a). O( log n )
b). O( n^2 )
c). O( 1 )
d). O( n )
1]
Answer =>a). Both pop and push take O(1) time.
all the standard stack operations (push, pop, isEmpty, size), the worst-case run-time complexity can be O(1).
2]
answer=>O(n)
dear friend given thumbs up
Get Answers For Free
Most questions answered within 1 hours.