Questions tagged [set]
A set is a collection in which no element is repeated, which may be able to enumerate its elements according to an ordering criterion (an "ordered set") or retain no order (an "unordered set").
                139 questions
            
            
            
                3
            
            votes
        
        
            
                1
            
            answer
        
        
            
                69
            
            views
        
        
            
            
        Ruby Array#own_uniq method
                    I have implemented my own version of Ruby's Array uniq-method (Ruby docs - Class array) as a monkey patch on Array.
Method-impl.:
...
                
            
       
        
            
                1
            
            vote
        
        
            
                1
            
            answer
        
        
            
                125
            
            views
        
        
            
            
        Rewriting the java.util.concurrent.ConcurrentSkipListMap to a version without concurrency constructs [closed]
                    I have essentially rewrote the java.util.concurrent.ConcurrentSkipListMap into a version without concurrency constructs (...
                
            
       
        
            
                3
            
            votes
        
        
            
                1
            
            answer
        
        
            
                107
            
            views
        
        
            
            
            
        Compare and merge sets from unstructured variables for automatic differentiation
                    I have developed an automatic differentiation module for my software. Usually AD comes in two forms; forward mode or reverse mode and very clever approaches, beyond me, might mix both. Typically the ...
                
            
       
        
            
                2
            
            votes
        
        
            
                1
            
            answer
        
        
            
                87
            
            views
        
        
            
            
            
        Set-like Operation in C - Advent of Code 2021 Day 3
                    I am relatively new to C programming and am currently completing challenges of Advent of Code 2021 to elevate my skills. I am excited to share my solution for the puzzle on Day 3 and am eager to ...
                
            
       
        
            
                1
            
            vote
        
        
            
                1
            
            answer
        
        
            
                138
            
            views
        
        
            
            
            
        Collection that uses a bitset to store a huge set of unique integers from a given range (rev. 1)
                    Some (skippable) context:
I'm writing program that minimizes an arbitrary logical function. Such function takes an unsigned integer as an argument and returns either ...
                
            
       
        
            
                3
            
            votes
        
        
            
                5
            
            answers
        
        
            
                249
            
            views
        
        
            
            
            
        Comparison of two excel files ignoring line order
                    Below is a simple method which compares contents of two excel files ignoring the line order.
This method is working as expected.
But, one of my peers in their code review mentioned that initializing ...
                
            
       
        
            
                3
            
            votes
        
        
            
                3
            
            answers
        
        
            
                190
            
            views
        
        
            
            
        IPv4 filter in Java
                    I have a simple class for representing IPv4-addresses via int values, and a simple IP-address filter that works like a set of IPv4-addresses.
...
                
            
       
        
            
                9
            
            votes
        
        
            
                3
            
            answers
        
        
            
                194
            
            views
        
        
            
            
        Compressed output of set in Python
                    In order to provide a better output of sets with many consecutive elements (a similar class could be written for a list or tuple,...
                
            
       
        
            
                3
            
            votes
        
        
            
                1
            
            answer
        
        
            
                257
            
            views
        
        
            
            
            
        Yet another Wordle Game
                    This Jupyter Notebook code for the Wordle game works. After a lot of fixes, I have it working as it should. The code is a jumbled mess. I am open to any suggestions and/or criticism of my code. I am ...
                
            
       
        
            
                1
            
            vote
        
        
            
                1
            
            answer
        
        
            
                74
            
            views
        
        
            
            
            
        SortedIntSet: a set of integers that can be iterated in ascending order in O(N) time
                    I needed a set with the following properties:
can be iterated in ascending or descending order in \$O(N)\$ time
the usual set operations (contains, add, remove, discard) can still be done in \$O(1)\$
...
                
            
       
        
            
                4
            
            votes
        
        
            
                1
            
            answer
        
        
            
                1k
            
            views
        
        
            
            
            
        Vectorset, a faster std::set
                    I decided to implement a vectorset, which is intended to be faster than std::set for the 3 fundamental operations, namely insert,...
                
            
       
        
            
                2
            
            votes
        
        
            
                1
            
            answer
        
        
            
                146
            
            views
        
        
            
        How many times element of one array occurs in another array?( HackerRank sparse arrays problem)
                    with basic knowledge of multiset and vectors in c++ I solved the following problem.
How can I improve my code and also handle any input errors?
Problem statement:
There is a collection of input ...
                
            
       
        
            
                2
            
            votes
        
        
            
                2
            
            answers
        
        
            
                184
            
            views
        
        
            
            
            
        Radio with channels
                    Realize the Radio and Channel classes that represent radio and a radio station. The radio class offers an argumentless constructor and the following methods:
addChannel: stores and returns a new ...
                
            
       
        
            
                1
            
            vote
        
        
            
                1
            
            answer
        
        
            
                116
            
            views
        
        
            
            
            
        A simple Java integer integer hash set - follow-up 2
                    (See the previous version.)
Now I have this:
com.github.coderodde.util.IntHashSet:
...
                
            
       
        
            
                6
            
            votes
        
        
            
                4
            
            answers
        
        
            
                1k
            
            views
        
        
            
            
            
        A simple Java integer hash set
                    (See the next version.)
The following data structure implements a hash table based set for int values:
...
                
            
       
         
         
        