describe the Worst Case of efficiency an algorithm can have in performing it’s job.
This efficiency is evaluated based on 2 factors:
gives a rough idea of how long it will take an algorithm to execute based on two things: the size of the input it has and the amount of steps it takes to complete.
total amount of space needed to complete the algorithm relate to the amount of input an algorithm has.
we should consider 4 Key Areas for analysis:
4 Key Areas for analysis:
Refer to the size of parameter that pass to Algorithm.
When evaluate the tim & space complexity we need these factor: for the time :
for the space
A linked list is a linear data structure, in which the elements are not stored at contiguous memory locations. The elements in a linked list are linked using pointers as shown in the below image:
In simple words, a linked list consists of nodes where each node contains a data field and a reference(link) to the next node in the list.