Implementation of sets using sorted lists 1.1 Python script

SPONSORED LINKS

    Specification

  • Version: 1.1
  • File size: 0 KB
  • File name: index_txt
  • Last update:
  • Platform: Windows / Linux / Mac OS / BSD / Solaris
  • Language: Python
  • Price:Other Free / Open So
  • Company: Raymond Hettinger (View more)

Implementation of sets using sorted lists 1.1 script description:




Publisher review:
Implementation of sets using sorted lists script shows you set operations using sorted lists as the underlying data structure. This script implements set operations using sorted lists as the underlying data structure. Advantages:
- Space savings -- lists are much more compact than a dictionary based implementation.
- Flexibility -- elements do not need to be hashable, only __cmp__ is required.
- Fast operations depending on the underlying data patterns.
- Non-overlapping sets get united, intersected, or differenced with only log(N) element comparisons.Results are built using fast-slicing.
- Algorithms are designed to minimize the number of compares which can be expensive.
- Natural support for sets of sets. No special accomodation needs to be made to use a set or dict as a set member, but users need to be careful to not mutate a member of a set since that may breaks its sort invariant.
Disadvantages:
- Set construction uses list.sort() with potentially N log(N) comparisons.
- Membership testing and element addition use log(N) comparisons. Element addition uses list.insert() with takes O(N) time.
Implementation of sets using sorted lists 1.1 is a Python script for Programming Methods and Algorithms scripts design by Raymond Hettinger. It runs on following operating system: Windows / Linux / Mac OS / BSD / Solaris.
shows you set operations using sorted lists as the underlying data structure.

Operating system:
Windows / Linux / Mac OS / BSD / Solaris

Latest script and internet news

222

222

22

Posted on: 18 Jul 2023 22:27 by A. Brown

111

111

111

Posted on: 18 Jul 2023 22:24 by A. Brown

The permanently active Push system offered by the new Google Chrome 42

The permanently active Push system offered by the new Google Chrome 42

Hacked By !Sc-sT

Posted on: 17 Mar 2015 07:57 by A. Brown

SPREAD THE WORD

User Rating


Rating: 2.2 out of 5
Based on 13 ratings. 13 user reviews.

  • Currently 2.15 out of 5
  • 1
  • 2
  • 3
  • 4
  • 5