Python-Scripts icon indicating copy to clipboard operation
Python-Scripts copied to clipboard

Create pigeonhole.py

Open uppy19d0 opened this issue 2 years ago • 2 comments

This code illustrates the Pigeonhole Sort algorithm:

  • It first identifies the minimum and maximum values in the input array to determine the range of values.

  • Then, it creates a "holes" list to keep track of the counts of each value.

  • It counts the occurrences of each value in the input array and stores them in the corresponding "holes."

  • Finally, it reconstructs the sorted array by placing the values back into the array according to the counts in the "holes."

  • The code effectively sorts the input array using the Pigeonhole Sort algorithm, where values are redistributed into their correct positions.

uppy19d0 avatar Oct 28 '23 14:10 uppy19d0

Sir, Please add the [hacktoberfest2023] , [hacktoberfest] and [hacktoberfest-accepted] Label. I will be very thankful to you.

uppy19d0 avatar Oct 28 '23 20:10 uppy19d0

Hi @uppy19d0 please update the main Readme.md

DhanushNehru avatar May 20 '24 13:05 DhanushNehru

s> Hi @uppy19d0 please update the main Readme.md

Done @DhanushNehru, please check the changes.

uppy19d0 avatar Jun 15 '24 04:06 uppy19d0