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? DS data-structures stack + – himanshu6398 asked Oct 9, 2018 • edited Oct 9, 2018 by himanshu6398 himanshu6398 426 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
3 votes 3 votes it should be 4n-2 Utkarsh Joshi answered Oct 9, 2018 Utkarsh Joshi comment Share Follow See 1 comment See all 1 1 comment reply himanshu6398 commented Oct 9, 2018 reply Follow Share Thank you so much 0 votes 0 votes Please log in or register to add a comment.