SamiTech Code
340 subscribers
132 photos
12 videos
4 files
87 links
Computer Science student and software developer focused on building impactful products, exploring AI, and solving real-world challenges with technology.
My portfolio.... sami.pro.et

“Your efforts today are your goals tomorrow.”
Download Telegram
Good Morning guys💫, Since we covered basic python programming, I think it's good to start 👇
Data stracture & Algorithm.

What do you think please give your thought in the comment section.✍️✍️✍️
STEP-BY-STEP DSA LEARNING ROADMAP (WITH PYTHON)💪
Phase 1 – Foundation📊 1.Time and Space Complexity: What we have to know?👇 -What is Time Complexity? -What is Space Complexity? -Why we need Complexity? -Big-O Notation -Common types of time complexity -How to understand each time complexity? -Focus on interview questions -Practice problem so guys since, we've started the 2nd phase DSA, let's prepare ourselves for our journey and stay focus on it we'll become smart💪
1
As a note👇
What is Time Complexity?
Time Complexity tells us:
How the running time of an algorithm grows as input size increases. NB: We don't measure time in seconds.
We measure number of operations.

What is Space Complexity?
Space Complexity tells us:
How much extra memory an algorithm uses as input size increases.
Why we need Complexity?
Imagine two programs solving the same problem:
Program A → works fast for small input but slow for large input
Program B → works fast even for large input
👉 Complexity helps us choose the better one.
👍2
Good Evening 👋
BIG-O NOTATION:👇
Big-O describes the worst-case performance Common time complexities 1. O(1) - Constant Time: Time doesn't depend on input size 2. O(n) - Linear Time: Time grows proportionally with input size 3. O(n²) - Quadratic Time: Nested loops 4. O(log n) - Logarithmic Time: input size halves each step 5. O(n log n) - Linear + Logarithmic Time: Combination of linear and logarithmic We'll see them one by one in the next..Stay tuned with me🧑‍💻
1
Good Morning fam
Happy sunday💫
SamiTech Code pinned «As a note👇 What is Time Complexity? Time Complexity tells us: How the running time of an algorithm grows as input size increases. NB: We don't…»
Guys HRU all just sorry for my late, since we've just started DSA this course is needed! you need to know the basic concept of DSA You can learn it from youtube tutorial, but since we're focused on Python programming watch this video there is about 20 videos you might get the basic understanding of DSA. he teaches DSA in python👉🏾 https://youtu.be/IR_S8BC8KI0?si=5E7Uwc4E2xGUiRW6
If someone ask you, what is Big O notation? In simple what is your answer? 👉🏾The letter O was chosen by Bachmann to stand for Ordnung, meaning the order of approximation. In computer science, big O notation is used to classify algorithms according to how their run time or space requirements grow as the input size grows. I'll post for you, what I get and you can do it so...
1
Keep in mind:
many of us know that we can use timers to test the speed of our code. But this raises a couple problems. The other main problem being that this still does not give us an objective way to talk about the difference between two blocks of code. This is exactly where Big O Notation comes into play. It provides a way for us to communicate the efficiency of our code in a way that is consistent and clear. So then what do we use if not time?👇 The simple answer is counting operations.
SamiTech Code pinned «Guys HRU all just sorry for my late, since we've just started DSA this course is needed! you need to know the basic concept of DSA You can learn it from youtube tutorial, but since we're focused on Python programming watch this video there is about 20 videos…»
I've defined function name called calcNumber(), then n parameter passed here so there is 3 operations these're *,/, & + then there're 3 operations here no matter if n increases just it's equal. cuz for all of them there is 3 operations. eg; n =100, & n=2. We don't care about n value but count the operations they are going to do one result. Look at this code:
def calcNumber(n):
return n * 3/2 + 4
print(calcNumber(6)) #What you've to understand here to say it's Big O notation there is no loop here there is only constant eg; O(1) == O(6) so we say that it's O(1) -> Constant.

In summary, an algorithm with an O(1) is the most preferable, and will always be more efficient than an algorithm of O(n). WHY? I'll give you the answer when we see O(n) & you can also try to guess it! cuz we're about to developing our understand in Algorithm,😁 with the next I'll share for you the graph of O(1)👇
Diagram of O(1) or constant algorithm
GN guys! see you morning
GM Fam🌅
The next point is O(n): If an operation has an O(n) (pronounced ‘O of N’), what this means is that, as ’n’ increases, so does the amount of operations needed to complete the problem. This is simple to understand, cuz it’s an entirely linear relationship. Here O(n) code looks like
def findNum(n):
for i in range(n):
print(i)

findNum(5)

To say it's linear Big O notation: Look at there is only one for loop it's not nested. when our n = 5 the time to complete this operation is also increase, and if n = 100 the time to complete this operation is also further increases, 👉🏾that's why O(1) is preferably than O(n). and then the graph of O(n) is👇
The Diagram of O(n) or Linear algorithm:👆
SamiTech Code pinned «The next point is O(n): If an operation has…»
Good Evening Guys🌃
I wish u're doing well and we'll keep learning without any stress💪Thanks for being with me🙏