Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: Powerset short-circuit optimization

by jimt (Chaplain)
on Oct 25, 2006 at 21:27 UTC ( [id://580656]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    
    For set A B C, you can enumerate the powerset in binary:
    ...
    0001   D
    0000
    
  2. or download this
    
    (for ABC)
    ...
    Have we seen C before? YES - return 2
    Have we seen D before? No? D == slot 3
    
  3. or download this
    
    By using a dead bit for A, we actually have this:
    ...
    0001   D
    0000
    
  4. or download this
    
    11111111111111111111111111  invalid
    ...
    00000000000000000000000010  invalid
    00000000000000000000000001  valid (z)
    
  5. or download this
    
    From up above, set (z)
    ...
    0001    D    (0001 & 0010 == 0)
    0000 ()        (0000 & 0010 == 0)
    
  6. or download this
    
    use strict;
    ...
    
    print "TOTAL CALLS $calls\n";
    
  7. or download this
    
    #!/usr/bin/perl
    ...
        @skippers{@future_skippers} = (1) x @future_skippers;
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://580656]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-19 01:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found