+ 4
Can Someone explain Time Complexity to me?
My apologies, I just truly do not understand the concept. Also, what's the deal with time complexity and dynamic arrays / linked lists? Are they different? Why? Would it be different if one was inserting data - or deleting data?
9 Respostas
+ 6
This is a good step-by-step explanation by Schindlabua:
https://code.sololearn.com/WS8SBRFRVxcn/?ref=app
+ 5
I found this https://stackoverflow.com/questions/11032015/how-to-find-time-complexity-of-an-algorithm
Which linked to this
https://www.bigocheatsheet.com/
+ 5
Time complexity describes how time scales, for a task, as the data/ input value increases.
There are certain task which happen at a constant time
i.e compariasons, assignments, return
Other task time scales linearly
i.e iterating through a list, finding the average value, or min/max of an unordered list
The more complex the more time
Ex find every possible
permutation of a set, time scales at a factorial rate
The deal with different containers is that each is one is built for having great time complexity for certain tasks
Ex dynamic arrays are great retriving an indexed value
But suck at inserting in the middle of a list
While linked list are the oppisite
+ 2
Annei ❤️ You are referring to the Big O..
The simplest algorithm is O(1).
and then scales up to enter the realm of exponentiation, thereby making it less efficient. Size and range of data play a very important role
+ 2
Check out Abdul Bari's videos on YouTube.
https://youtu.be/9TlHvipP5yA
- 1
Всем привет 🖐️
- 5
Hi