edited by
426 views
1 votes
1 votes
While calculating the cost of growable array-based stack.... the cost of n pushes came out as a series - 2 + 4 + 8 + 16 +......+2^(logn + 1) and it equals to 4n - 1. I didn't understand how the series sum equals to 4n?
edited by

1 Answer

Related questions

1 votes
1 votes
1 answer
1
amit166 asked Jan 6, 2019
1,412 views
How many enqueue and dequeue operations are required to perform a pop operation if Q1 contains n element initially?
7 votes
7 votes
1 answer
3
junaid ahmad asked Oct 31, 2017
3,967 views
Q.What will be time complexity of enqueue and dequeue operation when a queue is implemented using two stacks.
0 votes
0 votes
3 answers
4
vivek1211 asked Nov 6, 2022
753 views
The maximum size of the operator stack when converting the following infix to postfix expressiona ^ b * c * d + e * f ^ g (assume that “^” has highest precedence and ...