Question DSA-CX-0052
MediumA dynamic array doubles its capacity when full. What is the total copying cost of n appends?
- A.
O(log n)
- B.
O(n log n)
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Complexity Analysis question
A dynamic array doubles its capacity when full. What is the total copying cost of n appends?
O(log n)
O(n log n)
Sign up free to see the answer and a step-by-step explanation.
O(n²)
O(n)