Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i know that inserting an element to an array takes a constant time let us say c.

What I have tried:

for inserting n element time=
c+c+c+.......n times =nc

i want to ask that will it be big O of n or o(1)
Posted
Updated 4-Jul-18 4:28am
Comments
Richard MacCutchan 4-Jul-18 10:09am    
Try Google, it will give you lots of information about O(x) for different scenarios.
CPallini 4-Jul-18 13:03pm    
It depends. Reallocation could take place.

1 solution

Yeah, this smells of a homework question so you're not going to get a direct answer.

Google for "Big O notation" and you'll find plenty of information and examples.

Oh, a HUGE part of the job of software development is RESEARCH. You either learn how to do it on your own, or you're going to be a beginner in this business until you do.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900