Day 61 of 360: Learning Binary Search and Exploring Linux Services 🔍🐧
Hello everyone,
Today marks Day 61 of my 360 Days of Learning journey. I delved into the depths of the binary search algorithm and tackled some challenging problems on LeetCode. Additionally, I continued to enhance my DevOps and Cloud skills by learning about essential Linux services. Here’s what I achieved today! 🚀✨
Binary Search Algorithm in Python 🐍:
What is Binary Search?
Binary search is an efficient algorithm for finding an item from a sorted list of items. It works by repeatedly dividing the portion of the list that could contain the item in half until you’ve narrowed down the possible locations to just one. This algorithm operates in O(log n) time complexity, making it highly efficient for large datasets.
Problems Solved 💻:
1. Search Element:
Approach: I used three pointers (start, mid, end) to check if the target element is present in the array. The mid value is recalculated in each iteration until the target is found or the search space is exhausted.
2. First Occurrence:
Approach: I employed a store-and-compute strategy. The mid value is adjusted to move towards the leftmost occurrence of the target element, updating the store variable each time the target is found.
3. Last Occurrence:
Approach: Similar to finding the first occurrence, but in this case, the mid pointer is adjusted to move towards the rightmost occurrence of the target element.
4. Total Occurrence:
Approach: I combined the methods for finding the first and last occurrences. The total occurrence is calculated by subtracting the first occurrence index from the last occurrence index and adding one.
From these questions, I learned a lot about the binary search algorithm, its applications, and its implementation in Python. The problems allowed me to apply new methods and explore the use of STL for binary search.
DevOps and Cloud Learning ☁️:
In addition to programming, I continued enhancing my skills in DevOps and Cloud by learning about some essential Linux services:
Apache2:
Installed and configured Apache2, understanding its basic operations and how to serve web content efficiently.
MySQL Server:
Learned how to install and configure MySQL Server, including setting up databases and users, which is crucial for managing relational databases in a cloud environment.
These beginner-level explorations are building a strong foundation for my future endeavors in DevOps and Cloud Computing.
Join Me on This Journey 🌱:
I invite you all to follow along, share your thoughts, and connect with me as I continue this year-long educational adventure. Your support and insights will be greatly [appreciated!
Youtube:](https://lnkd.in/dM3f5RPr) https://lnkd.in/dM3f5RPr
Instagram: https://lnkd.in/dq4xRwJR
Github: https://lnkd.in/dhxkbRUv
Web: https://www.iamprashu.in
Hashnode: https://lnkd.in/drsHBbhU
Subscribe to my newsletter
Read articles from Prashant Joshi directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Prashant Joshi
Prashant Joshi
Fuelled by boundless passion for DevOps and cloud technologies ☁️☁️☁️ ☁️, I'm on an exhilarating journey of mastery of Computer Application (MCA). I'm not just learning; I'm devouring DevOps principles and cloud tech, crafting the future through relentless innovation and automation. 😉