Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update quicksort algorithm #48

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
112 changes: 56 additions & 56 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
# First-Python-Program - CONTRIBUTE FOR HACKTOBERFEST! ✔
### `Visual Studio Code` `Hacktoberfest'22`
## Introduction
I have listed some of the interesting python related topics and programs that I came across and would be fun for those who are learning python. Feel free to add basic python scripts that helped you learn python. Remember that making comments in the projects is helpful for learning.
## How to use
- Add your own project in the repository:
- create an individual subfolder named with the projects title
- add project in folder
- make README file explaining project functionality
- add username into README file
- Add helpful comments in higher level projects
- Add test cases for testing new changes
- Fork the project and work with the code to learn
## How to Fork and Contribute to the Main 💻👨‍💻
- Fork the given project- [How?](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork)
- Make a folder named after your program
- Add your program file
- Edit **README.md**- Index Section and add your program name as follows:
[Name of the Program](url)- [your full name](github-url)
- in **README.md** write about the purpose of the project and concepts or data structures used
- Start the repo & you are done!
## Index 📑:
1. [Count Primes](https://github.com/Aishanipach/Beginners-Python-Programs/tree/main/Count_primes)
2. [Three Cup Monty(extended)](https://github.com/Aishanipach/Beginners-Python-Programs/tree/main/Threecupsmonty)
3. [TicTacToe](https://github.com/Aishanipach/Beginners-Python-Programs/tree/main/TicTacToe)
4. [Summer of '69](https://github.com/Aishanipach/Beginners-Python-Programs/blob/main/Summerof'69.py)
5. [Tkinter](https://github.com/Aishanipach/Beginners-Python-Programs/tree/main/Tkinter)
6. [Card game project](https://github.com/Aishanipach/Beginners-Python-Programs/tree/main/Card_game_project)
7. [Web Scraping](https://github.com/Aishanipach/Beginners-Python-Programs/tree/main/Web%20scraping)
8. [Gmail Automation](https://github.com/Aishanipach/Beginners-Python-Programs/tree/main/Gmail%20automation)
9. [GUI Calculator](https://github.com/1-Rishabh-Jain-1/Beginners-Python-Projects/blob/main/gui_calculator.py)
10. [Higher Lower Game](https://github.com/TheTriangulam/Beginners-Python-Projects/tree/main/Num_guess_by_Comp)- [Devivaraprasad Rathikindi](https://github.com/TheTriangulam)
11. [Tkinter Recommendation System](https://github.com/varshaah2407/Beginners-Python-Projects/tree/main/Tkinter_recommendation_system) - [Varshaah Shashidhar](https://github.com/varshaah2407)
12. [prime numbers in a range](https://github.com/AG-444/Beginners-Python-Projects_AP/blob/main/prime_numbers_in_input_range.py) - [Aditya Garg](https://github.com/AG-444)
13. [Swap elements in an array](https://github.com/AG-444/Beginners-Python-Projects_AP/blob/main/swap_elements_in_array.py) - [Aditya Garg](https://github.com/AG-444)
14. [sum of elements of an array](https://github.com/AG-444/Beginners-Python-Projects_AP/blob/main/sum_of_elements_of_an_array.py) - [Aditya Garg](https://github.com/AG-444)
15. [print_diamond_shape](https://github.com/AG-444/Beginners-Python-Projects_AP/blob/main/diamond_symbol.py) - [Aditya Garg](https://github.com/AG-444)
16. [email response sender](https://github.com/arnavvgupta/email-response-sender) - [Arnav Gupta](https://github.com/arnavvgupta)
17. [Quick Sort](https://github.com/varshaah2407/Beginners-Python-Projects/blob/main/quick_sort.py) - [Varshaah Shashidhar](https://github.com/varshaah2407)
18. [aritmetic median, biggest number and lowest number](https://github.com/arnavvgupta/functionMaxMinMedian.py)
19. [Insertion Sort](https://github.com/musaibbatghar/Beginners-Python-Projects/blob/main/Insertion_Sort.py) - [Musaib Batghar](https://github.com/musaibbatghar)
20. [Snake game](https://github.com/Aishanipach/Beginners-Python-Projects/compare/main...meanshkumar:Beginners-Python-Projects:main?expand=1)- [Ansh Kumar](https://github.com/meanshkumar)
21. [Merge_Sort](https://github.com/proPrateekSahu/Beginners-Python-Projects/blob/main/MergeSort.py) - [Prateek Kumar Sahu](https://github.com/proPrateekSahu)
22. [Binary_Search](https://github.com/proPrateekSahu/Beginners-Python-Projects/blob/main/BinarySearch) - [Prateek Kumar Sahu](https://github.com/proPrateekSahu)
23. [Fibonacci_Series](https://github.com/Skillz619/Beginners-Python-Projects/blob/main/fibonacci_series.py) - [Shreekar Kolanu](https://github.com/Skillz619)
24. [Binary_Search](https://github.com/proPrateekSahu/Beginners-Python-Projects/blob/main/BinarySearch) - [Prateek Kumar Sahu](https://github.com/proPrateekSahu)
25. [TowerOfHoni](https://github.com/proPrateekSahu/Beginners-Python-Projects/blob/main/towerOfHoni.py) - [Prateek Kumar Sahu](https://github.com/proPrateekSahu)
26. [Matrix_Multiplier](https://github.com/proPrateekSahu/Beginners-Python-Projects/blob/main/MatrixMultiplier.py) - [Prateek Kumar Sahu](https://github.com/proPrateekSahu)
27. [Create Code To Find LCM](https://github.com/abhaypratapsinghkanpur/Beginners-Python-Projects/blob/main/Code%20To%20Find%20LCM) - [Abhay Pratap Singh](https://github.com/abhaypratapsinghkanpur)
28. [Create Python Program to Find the Square Root.py](https://github.com/abhaypratapsinghkanpur/Beginners-Python-Projects/blob/main/Create%20Python%20Program%20to%20Find%20the%20Square%20Root.py) - [Abhay Pratap Singh](https://github.com/abhaypratapsinghkanpur)
29. [Caeser Cipher](https://github.com/Damsith-LK/Beginners-Python-Projects/blob/main/Caeser%20Cipher.py) - [Damsith Wijekoon](https://github.com/Damsith-LK)
30. [DNA Sequence Analysis](https://github.com/Aishanipach/Beginners-Python-Programs/tree/main/DNA_Sequence_Analysis) - [Amelia Lauth](https://github.com/alauth22)
# First-Python-Program - CONTRIBUTE FOR HACKTOBERFEST! ✔
### `Visual Studio Code` `Hacktoberfest'22`
## Introduction
I have listed some of the interesting python related topics and programs that I came across and would be fun for those who are learning python. Feel free to add basic python scripts that helped you learn python. Remember that making comments in the projects is helpful for learning.

## How to use
- Add your own project in the repository:
- create an individual subfolder named with the projects title
- add project in folder
- make README file explaining project functionality
- add username into README file
- Add helpful comments in higher level projects
- Add test cases for testing new changes
- Fork the project and work with the code to learn

## How to Fork and Contribute to the Main 💻👨‍💻
- Fork the given project- [How?](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork)
- Make a folder named after your program
- Add your program file
- Edit **README.md**- Index Section and add your program name as follows:
[Name of the Program](url)- [your full name](github-url)
- in **README.md** write about the purpose of the project and concepts or data structures used
- Start the repo & you are done!

## Index 📑:
1. [Count Primes](https://github.com/Aishanipach/Beginners-Python-Programs/tree/main/Count_primes)
2. [Three Cup Monty(extended)](https://github.com/Aishanipach/Beginners-Python-Programs/tree/main/Threecupsmonty)
3. [TicTacToe](https://github.com/Aishanipach/Beginners-Python-Programs/tree/main/TicTacToe)
4. [Summer of '69](https://github.com/Aishanipach/Beginners-Python-Programs/blob/main/Summerof'69.py)
5. [Tkinter](https://github.com/Aishanipach/Beginners-Python-Programs/tree/main/Tkinter)
6. [Card game project](https://github.com/Aishanipach/Beginners-Python-Programs/tree/main/Card_game_project)
7. [Web Scraping](https://github.com/Aishanipach/Beginners-Python-Programs/tree/main/Web%20scraping)
8. [Gmail Automation](https://github.com/Aishanipach/Beginners-Python-Programs/tree/main/Gmail%20automation)
9. [GUI Calculator](https://github.com/1-Rishabh-Jain-1/Beginners-Python-Projects/blob/main/gui_calculator.py)
10. [Higher Lower Game](https://github.com/TheTriangulam/Beginners-Python-Projects/tree/main/Num_guess_by_Comp)- [Devivaraprasad Rathikindi](https://github.com/TheTriangulam)
11. [Tkinter Recommendation System](https://github.com/varshaah2407/Beginners-Python-Projects/tree/main/Tkinter_recommendation_system) - [Varshaah Shashidhar](https://github.com/varshaah2407)
12. [prime numbers in a range](https://github.com/AG-444/Beginners-Python-Projects_AP/blob/main/prime_numbers_in_input_range.py) - [Aditya Garg](https://github.com/AG-444)
13. [Swap elements in an array](https://github.com/AG-444/Beginners-Python-Projects_AP/blob/main/swap_elements_in_array.py) - [Aditya Garg](https://github.com/AG-444)
14. [sum of elements of an array](https://github.com/AG-444/Beginners-Python-Projects_AP/blob/main/sum_of_elements_of_an_array.py) - [Aditya Garg](https://github.com/AG-444)
15. [print_diamond_shape](https://github.com/AG-444/Beginners-Python-Projects_AP/blob/main/diamond_symbol.py) - [Aditya Garg](https://github.com/AG-444)
16. [email response sender](https://github.com/arnavvgupta/email-response-sender) - [Arnav Gupta](https://github.com/arnavvgupta)
17. [Quick Sort](https://github.com/varshaah2407/Beginners-Python-Projects/blob/main/quick_sort.py) - [Varshaah Shashidhar](https://github.com/varshaah2407)
18. [aritmetic median, biggest number and lowest number](https://github.com/arnavvgupta/functionMaxMinMedian.py)
19. [Insertion Sort](https://github.com/musaibbatghar/Beginners-Python-Projects/blob/main/Insertion_Sort.py) - [Musaib Batghar](https://github.com/musaibbatghar)
20. [Snake game](https://github.com/Aishanipach/Beginners-Python-Projects/compare/main...meanshkumar:Beginners-Python-Projects:main?expand=1)- [Ansh Kumar](https://github.com/meanshkumar)
21. [Merge_Sort](https://github.com/proPrateekSahu/Beginners-Python-Projects/blob/main/MergeSort.py) - [Prateek Kumar Sahu](https://github.com/proPrateekSahu)
22. [Binary_Search](https://github.com/proPrateekSahu/Beginners-Python-Projects/blob/main/BinarySearch) - [Prateek Kumar Sahu](https://github.com/proPrateekSahu)

23. [Fibonacci_Series](https://github.com/Skillz619/Beginners-Python-Projects/blob/main/fibonacci_series.py) - [Shreekar Kolanu](https://github.com/Skillz619)
24. [Binary_Search](https://github.com/proPrateekSahu/Beginners-Python-Projects/blob/main/BinarySearch) - [Prateek Kumar Sahu](https://github.com/proPrateekSahu)
25. [TowerOfHoni](https://github.com/proPrateekSahu/Beginners-Python-Projects/blob/main/towerOfHoni.py) - [Prateek Kumar Sahu](https://github.com/proPrateekSahu)
26. [Matrix_Multiplier](https://github.com/proPrateekSahu/Beginners-Python-Projects/blob/main/MatrixMultiplier.py) - [Prateek Kumar Sahu](https://github.com/proPrateekSahu)
27. [Create Code To Find LCM](https://github.com/abhaypratapsinghkanpur/Beginners-Python-Projects/blob/main/Code%20To%20Find%20LCM) - [Abhay Pratap Singh](https://github.com/abhaypratapsinghkanpur)
28. [Create Python Program to Find the Square Root.py](https://github.com/abhaypratapsinghkanpur/Beginners-Python-Projects/blob/main/Create%20Python%20Program%20to%20Find%20the%20Square%20Root.py) - [Abhay Pratap Singh](https://github.com/abhaypratapsinghkanpur)
29. [Caeser Cipher](https://github.com/Damsith-LK/Beginners-Python-Projects/blob/main/Caeser%20Cipher.py) - [Damsith Wijekoon](https://github.com/Damsith-LK)
30. [DNA Sequence Analysis](https://github.com/Aishanipach/Beginners-Python-Programs/tree/main/DNA_Sequence_Analysis) - [Amelia Lauth](https://github.com/alauth22)
13 changes: 11 additions & 2 deletions tempCodeRunnerFile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
rr,lb,ub):
def quicksort(arr, lb, ub):
if (lb < ub):
loc = partition(arr,lb,ub)
Quicksort(arr,lb,loc-1)
Quicksort(arr,loc+1,ub)
Quicksort(arr,loc+1,ub)
def partition(arr, lb, ub):
pivot = arr[ub]
i = lb - 1
for j in range(lb, ub):
if arr[j] <= pivot:
i += 1
arr[i], arr[j] = arr[j], arr[i]
arr[i + 1], arr[ub] = arr[ub], arr[i + 1]
return i + 1