Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 75 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,84 @@
<!--hide-->
# Algorithm optimization in Python - Step by step guide
<!--endhide-->
Algorithm Optimization in Python
Step-by-Step Guide to Optimizing Python Code

- Optimize Python code.
Welcome to the Algorithm Optimization Project! This repository is designed to guide you through practical exercises to improve the efficiency and performance of Python code, step by step. Whether you're a beginner learning about algorithm optimization or a developer looking to sharpen your skills, this project will provide a hands-on approach to writing cleaner, faster, and more efficient code.

## 🌱 How to start this project
🌟 Project Overview
The goal of this project is to help you:

Follow the instructions below:
Understand common optimization techniques for Python algorithms.
Improve your problem-solving and coding skills by tackling real-world challenges.
Write code that is not only correct but also efficient.
You will be working through a series of exercises provided in a Jupyter Notebook, where you will analyze, optimize, and refactor Python code step by step.

1. Create a new repository by forking the [Git project](https://github.com/4GeeksAcademy/algorithm-optimization-project-machine-learning) or [by clicking here](https://github.com/4GeeksAcademy/algorithm-optimization-project-machine-learning/fork).
2. Open the newly created repository in Codespace using the [Codespace button extension](https://docs.github.com/en/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository).
3. Once the Codespace VSCode has finished opening, start your project by following the instructions below.
🚀 How to Start This Project
Follow these steps to get started:

## 🚛 How to deliver this project
Fork this repository: Click the Fork button at the top of the repository or click here.
Clone your repository: Use git clone to download your forked repository.
bash
Copiar código
git clone https://github.com/your-username/algorithm-optimization-project-machine-learning.git
Open in Codespace (Optional): If you use GitHub Codespaces, click the "Open in Codespace" button to set up a development environment instantly.
Install Dependencies: Ensure you have Python and Jupyter Notebook installed. Use the following command to install the required packages:
bash
Copiar código
pip install jupyter pandas numpy
Launch the Notebook: Open the problems.ipynb file in Jupyter Notebook:
bash
Copiar código
jupyter notebook ./notebook/problems.ipynb
📋 How to Deliver This Project
Complete all the exercises in the problems.ipynb file.
Commit and push your changes to your forked repository.
Submit the repository link on 4Geeks.com to deliver your project.
📝 Instructions
Once you've set up the project, you will find a Jupyter Notebook at ./notebook/problems.ipynb containing a series of exercises.

Once you have finished solving the exercises, be sure to commit your changes, push to your repository and go to 4Geeks.com to upload the repository link.
Steps to Complete
Open the notebook file in your development environment.
Read each exercise carefully and follow the instructions provided.
Optimize the Python code as required, improving its performance and efficiency.
Test your solutions to ensure they work correctly and efficiently.
✅ Example Exercise
To give you an idea, here’s an example of an exercise you might encounter:

## 📝 Instructions
"Given an unsorted list of integers, write an optimized function to find the largest number. Compare its runtime before and after optimization."

Once you start working on the project, you will see a `./notebook/problems.ipynb` file containing a list of exercises. Complete each of them, one by one.
Example of an unoptimized function:

> Note: We also incorporated a `./notebook/solutions.ipynb` file that we strongly suggest you only use if you are stuck for more than 30 min or if you have already finished and want to compare it with your approach.
def find_largest(nums):
largest = nums[0]
for i in range(len(nums)):
if nums[i] > largest:
largest = nums[i]
return largest
Optimized version:

def find_largest(nums):
return max(nums)
💡 Why Algorithm Optimization Matters
Algorithm optimization is a critical skill for developers as it directly impacts the performance of applications, scalability, and user experience. By optimizing code:

You reduce runtime and memory usage.
You improve the scalability of applications.
You write cleaner, more maintainable code.
📚 Resources
Here are some resources to help you with this project:

Python Documentation
Big O Notation Explained
Jupyter Notebook Guide
🤝 Contributing
We welcome contributions! If you have suggestions for improving this project, feel free to fork the repository, make changes, and open a pull request.

💻 Technologies Used
Python
Jupyter Notebook
🏆 Project Goals
By completing this project, you will:

Gain hands-on experience with algorithm optimization.
Learn to identify performance bottlenecks.
Develop problem-solving skills that are essential for real-world coding challenges.
Happy Coding! 🚀