🚀 Day-37 of #100DaysOfCode 🐍 Python Sorting Algorithm Challenge Today I implemented Quick Sort, a powerful and efficient sorting algorithm based on the divide and conquer technique. 🔹 What is Quick Sort? Quick Sort works by: Selecting a pivot element Partitioning the array so that elements smaller than the pivot are on the left and larger ones on the right Recursively applying the same logic to subarrays 🔹 Concepts Practiced: ✔ Recursion ✔ Partitioning logic ✔ In-place swapping ✔ Divide and Conquer strategy 🔹 Approach: Choose the last element as the pivot Rearrange elements around the pivot Recursively sort the left and right partitions 🔹 Key Insight: Quick Sort has an average time complexity of O(n log n) and is widely used due to its speed and in-place sorting nature. Implementing such algorithms helps deepen understanding of efficient data processing and algorithmic thinking 💡 #Python #QuickSort #SortingAlgorithms #DivideAndConquer #CorePython #DSA #100DaysOfCode #Day37 #LearnPython #CodingPractice #PythonDeveloper
Implementing Quick Sort Algorithm in Python
More Relevant Posts
-
🚀 Day-38 of #100DaysOfCode 🐍 Python Sorting Algorithm Challenge Today I implemented Selection Sort from scratch to sort a list of numbers provided by the user—without using any built-in sorting methods. 🔹 What is Selection Sort? Selection Sort repeatedly selects the smallest element from the unsorted portion of the list and places it at the correct position. 🔹 Concepts Practiced: ✔ Nested loops ✔ Minimum element selection logic ✔ Index tracking ✔ In-place swapping 🔹 Approach: Iterate through the list Find the minimum element in the remaining unsorted part Swap it with the current index Repeat until the list is fully sorted 🔹 Key Insight: Selection Sort has a time complexity of O(n²), making it useful for understanding sorting fundamentals rather than large datasets. Working through such algorithms builds strong foundational knowledge of sorting and array manipulation 💡 #Python #SelectionSort #SortingAlgorithms #CorePython #100DaysOfCode #Day38 #LearnPython #CodingPractice #PythonDeveloper
To view or add a comment, sign in
-
-
I'm committing to building popular ML algorithms from scratch daily without using anything but Python built-ins and NumPy. No sklearn. No shortcuts. Just pure code and first principles. Day 2: Linear Regression ✅ Linear Regression intuition is simple: imagine you're trying to draw the best possible straight line through a scatter of points on a graph. That line represents the relationship between your input and output. But how do we find the "best" line? That's where Gradient Descent comes in. We start with a random line, measure how wrong it is using the Mean Squared Error, then slowly nudge the line in the direction that reduces the error, repeating this thousands of times until we converge. This is fully open if you want to collaborate, add an algorithm, or drop a suggestion in the comments or issues tab. Feel free to do so. 🤝 👉 GitHub: https://lnkd.in/duTd7jie #MachineLearning #Python #NumPy #DataScience #OpenSource #LearnML #100DaysOfCode #LinearRegression #GradientDescent
To view or add a comment, sign in
-
-
Day 23 of my #100DaysOfCode challenge 🚀 Today I implemented Linear Search in Python. Linear Search is the simplest searching algorithm where we check each element one by one until the target element is found. What the program does: • Takes a list and a target value • Iterates through the list sequentially • Returns the index if the target is found • Returns -1 if the target does not exist How the logic works: 1)Define a function linear_search(arr, target) 2)Use a for loop to iterate through the list using indices 3)Compare each element with the target value 4)If a match is found, return the current index 4)If the loop completes without finding the target, return -1 Example: Input: List:[10, 20, 30, 40, 50, 60, 70, 80, 90] Search Target 1: 50 Search Target 2: 100 Output: Target 50 found at index: 4 Target 100 not found in the list. Why Linear Search matters: – Works on both sorted and unsorted arrays – Simple and easy to implement – Time Complexity: O(n) Key learnings from Day 23: – Understanding basic searching algorithms – Comparing Linear Search vs Binary Search – Strengthening fundamentals of iteration – Improving algorithmic thinking #100DaysOfCode #Day23 #Python #PythonProgramming #LinearSearch #Algorithms #DataStructures #ProblemSolving #CodingPractice #LearnByDoing #ComputerScience #InterviewPrep #BTech #CSE #AIandML #VITBhopal #TechJourney
To view or add a comment, sign in
-
-
A bit about CONDITIONAL STATEMENTS. Python allows us to control program flow based on conditions that evaluate to True or False. They work with numbers, strings, booleans and even dictionaries because Python evaluates them into Boolean values behind the scenes. It simply executes this command: "If this is true, do this, if not, try something else. Otherwise do this" Conditional statements is one of the fundamentals of automation and machine learning. Without them, we can't build logic, models or intelligent systems. I had an interesting moment learning this basics along many others. The journey continues #RisewithTechCrush #Tech4Africans #LearningwithTechcrush
To view or add a comment, sign in
-
-
Not all preprocessing is the same. Sometimes, the difference is mathematical. In this project, I focused on feature transformation specifically understanding when to scale and when to normalize. Using Python, I worked with real-world data to: • Apply Min-Max Scaling for distance-based algorithms • Use Box-Cox transformation to correct skewed distributions • Compare distribution behavior before and after transformation • Analyze how statistical assumptions influence model choice The objective wasn’t just transformation. It was understanding why certain models require specific data behavior. Scaling adjusts magnitude. Normalization adjusts distribution. Small preprocessing decisions can significantly influence model stability and interpretability. #DataScience #MachineLearning #RegressionAnalysis #Statistics #FeatureEngineering #Python
To view or add a comment, sign in
-
#Projects 🚀 Excited to share my latest project: Thread Shed 🧵✨ https://lnkd.in/gssBsFwy Working with complex string data in Python has always fascinated me. This project was born out of the challenge of handling messy, layered text structures and turning them into something clean, efficient, and insightful. 🔹 Why it matters: Speeds up data parsing and transformation Handles intricate string manipulations with clarity Demonstrates how concurrency can simplify real-world text-heavy workflows 👉 I’d love to hear how others approach complex string challenges in Python. Do you lean on regex, threading, or something else entirely? #Python #Threading #StringProcessing #DataEngineering #Innovation Would you like me to make this post more technical (with code snippets and performance metrics) or more story-driven (focusing on your personal journey and motivation)?
To view or add a comment, sign in
-
-
Python isn’t magical. It’s precise. And precision has consequences. Continuing my deep dive into sequences… * with lists can be a little mischievous. grid = [['_'] * 3] * 3 Looks like a clean 3×3 grid. Until you do: grid[1][2] = 'X' And suddenly every row changes. Why? Because * didn’t copy the inner list — it copied the reference to it. The safer version? grid = [['_'] * 3 for _ in range(3)] Now each row is independent. Also interesting: += on lists mutates in place. * with tuples creates a new tuple object with a separate id. And when assigning to a slice, the right side must be iterable: l[2:5] = [100] The more I explore sequences, the clearer it becomes — Still learning... #PythonLearning #BackendEngineering #FinTechCareers
To view or add a comment, sign in
-
Andrej Karpathy implemented a GPT in 200 lines of pure Python. No libraries. Just math and loops. I drew the architecture while reading through it — sometimes you need to see a thing to actually understand it. What makes this special is that nothing is hidden. You can follow a single character token from input all the way through embeddings, attention heads, MLP, and back out as a probability. Then watch Adam nudge the weights. Then see it generate a new name character by character. Decoder-only transformers suddenly feel a lot less mysterious. Notebook link in the comments if you want to explore it yourself 👇
To view or add a comment, sign in
-
-
LeetCode Problem 160: "Intersection of two Linked Lists": Given the heads of two singly linked-lists headA and headB, return the node at which the two lists intersect. If the two linked lists have no intersection at all, return null. Approach: Use two pointers technique, maintain one pointer at list A and another at list B, at each iteration check whether pointers point to the same node, if yes then return that node. If pointer A reaches end update it to point to the head of list B and if pointer B reaches end update it to point to the head of list A. In this way each of the pointers traverses both of the lists. Time complexity: O(m+n) Space Complexity: O(1) #LeetCode #LinkedLists #Python #CompetitiveProgramming #ProblemSolving #Algorithms #DataStructures
To view or add a comment, sign in
-
-
🚨BIG BREAKING: Just 243 line of code to train GPT model without any framework. Pure plain python code. That’s called “microgpt” Andrej Karpathy build entire architecture and shared it to learn, experiment with it. Column 1: Dataset, Tokenizer, Autograd Column 2: GPT model Column 3: Training, Inference X post: https://lnkd.in/gvNHTpyy
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development
Great Work 🔥