Skip to main content

A sorted multiset which is similar to multiset of cpp so can developers access,delete,search elements in O(log n) time which can make job easy.Helpful for coders.

Project description

Example Package

User Guide GitHub-flavored Markdown

1)A orderdmultiset is a module which has same behavior like cpp multiset.

2)it is most important for cosing community which help to grow python in coding community.

3)it has various functions like appending an element, erasing an element,searching an element, poping out an element from left and poopoing out an element from right all operations done in O(log n) times.

4)we can make a ascending multiset as well as descending multiset via providing a parameter in object reverse=True for descending.

  • How to create multiset :--> For asceding multiset:-> var_name=sortedmultiset.sortedmultiset(reverse=False)#--->To create an object of ascending sorted multiset . -reverse=False is optional for ascending multiset it is bydefault parameter. For descending multiset:-> var_name=sortedmultiset.sortedmultiset(reverse=True)#--->To create an object of descending sorted multiset. -reverse=True is required while creating descending multiset. -Functions :--> var_name.append(element:int)#---> To add an element in O(log n). var_name.search(element:int)#--->To search an element in O(log n). var_name.erase(element:int)#--->To delete an element in O(log n). var_name.popleft()#--------> To delete the First/Leftmost most element in O(log n). var_name.popright()#--------> To delete the Last/Rightmost most element in O(log n).

-To access all the stored elements u can use following syntax:--> var_name.multiset---> A list where all the element are stored.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sortedmultiset-1.1.1.tar.gz (4.4 kB view hashes)

Uploaded Source

Built Distribution

sortedmultiset-1.1.1-py3-none-any.whl (5.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page