SamiTech Code
340 subscribers
124 photos
12 videos
4 files
83 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
👍2
SELECTION SORT: The definitions👇
Here in my own word I understand in this way; You are given an integer list of array then, you scan all numbers in your minds. At the first this question have to come to your mind. You look at the elements, then you pick out the smallest numbers then compare with the first position(index). Then you swap them together. this process is repeatedly goes through the logic until order(sorting) satisfied.

Not end yet😁
given a list for array numbers: [3, 2, 4, 1] what we've to do is by using selection sort and sort the numbers.

Btw am using the code editor on w3school ONINE NOT OFFLINE👨‍💻. In the case of my pc is not working for me in efficient way.😔 We don't have to worry for that. Cause since we're learning DSA, WE'RE PROBLEM SOLVER. if one things said NO, may be the other one can say YES😄
SamiTech Code pinned «https://youtu.be/gcRUIO-8r3U?si=Rhu_wwzMYHKtuNrL In this's video you get interesting understanding😊»
Now am in class & learning DSA in....? what do u think🤔
Anonymous Quiz
48%
Python
41%
C++
11%
Java
Good Morning🤗
👍3
Merge Sort:
splits the array into halves, sorts each half, then merges them back in sorted order.
It uses Divide & Conquer.
How to understand Merging Sort🤔
For instance: look at the following.
[5, 2, 4, 1]
Divide
[5, 2] [4, 1]
Divide again
[5] [2] [4] [1]
Merging sort happens here👇
[2, 5] [1, 4]
Final merge
[1, 2, 4, 5]
👍2
Good Evening guys. Now am about to start my studying🧑‍💻
Simple diagram for merge sort
def merge(left, right):
result = []
i = 0
j = 0

# Compare elements from both arrays
while i < len(left) and j < len(right):
if left[i] <= right[j]:
result.append(left[i])
i += 1
else:
result.append(right[j])
j += 1

# Add remaining elements
result.extend(left[i:])
result.extend(right[j:])

return result


"""
Merge sort keep in mind
Uses recursion
Sorting happens during merge
Time complexity: O(n log n)
Extra space needed(not in-place)
"""
Morning everyone💫
Am in class learning Discreate Maths.
It's all about Methods Of mathematical proof. Almost this course is related with DSA. It means solving problems. Therefore, student in CS, IT, IS, & SW.Eng they've to focus on it🫡
I'm out of mind. Cause our instructor teaching technique. He makes me to sleep. It's so borring🥱 Therefore what would be my choice🤔
Anonymous Quiz
43%
It's better to leave the class
36%
Have a patience
21%
Try to read some article
What is Numpy:
-NumPy is a Python library.
-NumPy is used for working with arrays.
-NumPy is short for "Numerical Python".
👍2
Why Use NumPy?
In Python we have lists that serve the purpose of arrays, but they are slow to process.
The array object in NumPy is called ndarray, it provides a lot of supporting functions that make working with ndarray very easy.
Arrays are very frequently used in data science & also ML, where speed and resources are very important.
Why is NumPy Faster Than Lists?
NumPy arrays are stored at one continuous place in memory unlike lists, so processes can access and manipulate them very efficiently.
This behavior is called locality of reference in computer science.
This is the main reason why NumPy is faster than lists. Also it is optimized to work with latest CPU architectures
What does Numpy stands for?
Anonymous Quiz
0%
Number picker
0%
Numerical platform
100%
Numerical python
How to import numpy:👇
import numpy
arr = numpy.array([1,2,3,4,5])
print(arr)

don't forget to use array keyword👉🏽 numpy.array
We use NumPy instead of Python lists for numerical and scientific computing primarily because NumPy arrays offer superior performance, memory efficiency,
and a rich set of mathematical functions.