Difference between revisions of "Talk:2483: Linked List Interview Problem"
(Explain O notation) |
|||
Line 1: | Line 1: | ||
<!--Please sign your posts with ~~~~ and don't delete this text. New comments should be added at the bottom.--> | <!--Please sign your posts with ~~~~ and don't delete this text. New comments should be added at the bottom.--> | ||
Assuming not everyone understands O notation: O(1) means that it always takes the same time, no matter how much data is stored. O(n) means the time is proportional to the amount of data stored - if you have 10 times the data, it takes 10 times as long to find the one you want. | Assuming not everyone understands O notation: O(1) means that it always takes the same time, no matter how much data is stored. O(n) means the time is proportional to the amount of data stored - if you have 10 times the data, it takes 10 times as long to find the one you want. | ||
+ | |||
+ | This code won't mail the linked list to a museum - it will mail the memory location of the head of the list to a museum. |
Revision as of 04:23, 1 July 2021
Assuming not everyone understands O notation: O(1) means that it always takes the same time, no matter how much data is stored. O(n) means the time is proportional to the amount of data stored - if you have 10 times the data, it takes 10 times as long to find the one you want.
This code won't mail the linked list to a museum - it will mail the memory location of the head of the list to a museum.