Data Structures

The data structure is the arrangement of data in the main memory(RAM)

Time Complexity and BIG O: Time complexity is defined as the time taken to run algorithms and it is represented as O(..).Based on the time complexity we need to choose which algorithm is the best to execute a program how much is it efficient we need to decide that's the task. I have a question about how do I know which algorithm is the best yo! Well, the answer is clear by knowing the time complexity of that particular algorithm. #cool

Let's See how to calculate the time complexity of algorithms. Let me give you an example I wanted to borrow a game from my friend. I have two algorithms in my mind one is getting the hard disk from my friend and the other way is to send that copy to my drive or through the drop box Algo 1 :- In algo the process depends upon the traveling time but doesn't depend upon the input (size of the game) Algo 2 :- In this the process to accomplish depends upon the input size of the game. As the input size increases the execution time also increases right. That's awesome bro. let us think In algo 1(n) = k1+k2+k3+k4 --k is the constant for denoting time as it doesn't depend upon the input size there is no change in time the time remains constant right k1*n^0 So the time complexity is O(1) -- Constant time

In algo 2: k1+k2(n^1) as we know speed = distance/time k2 is the time right == the time taken is dis/speed here dis is n(the size of the input) and the speed is internet speed right ok So l1+n/l2==l1+l2'n ===o(n) here l1 is the preparing all the things like turning on comp like that The time complexity is O(N) --- linear time ok

By the way what is BIG O ???? Well let me clear that