Skip to main content

All Questions

Tagged with
2 votes
4 answers
179 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 ...
AutoTester999's user avatar
4 votes
1 answer
892 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,...
verven's user avatar
  • 41
2 votes
3 answers
223 views

Sort an array of integers with a hashset

I was trying to make a sorting algorithm for an array of integers. Here's are the steps/theory: It turns an array into a HashSet, iterates over every integer value ...
Kudos B's user avatar
  • 21
6 votes
1 answer
430 views

Remove elements compared with other elements in a Set based on a condition

Simplified the actual problem to focus on comparing/removing performance. Given a set S with n elements , find the most optimal way to compare each element to all others until a condition is met that ...
Arjen's user avatar
  • 63
0 votes
1 answer
107 views

java.util.Set extension/implementation

Lately, I was working on some experimental java.util.Set extension, IdSet: ...
Wojciech Karwacki's user avatar
3 votes
1 answer
964 views

Extract index of first unique element in large array in Swift

I'm using the following code to return the first index of a unique character in a large String. It works fine until I get to large strings, where it times out. Is ...
Adrian's user avatar
  • 196
2 votes
1 answer
8k views

Remove Duplicates from Array in Swift 3.0

I ran the following code through a Leetcode.com challenge and it says the runtime for the test cases is 119ms, which puts it at the back of the pack performance wise. The goal is to remove duplicates ...
Adrian's user avatar
  • 196
4 votes
3 answers
3k views

Generate powerset in JS

I came across a mock interview question in which the candidate is asked to generate the powerset of a given set. The input set is represented as a unique array of integers. There was no solution ...
Luke's user avatar
  • 191
4 votes
4 answers
181 views

Increase performance of a method which finds the element removed from an array

Imagine that you have a TreeSet of numbers, and you copy them into an array, but you remove one element of it. You want to know the element removed. ...
Manuelarte's user avatar
8 votes
3 answers
3k views

Two sets came to an intersection

Challenge: Print set intersections. Specifications: Your program should accept as its first argument a path to a filename. Each line in the file is a test case. Each test case contain two ...
Legato's user avatar
  • 9,829
7 votes
4 answers
3k views

Faster Way of Comparing Generic Sets

The following extension method is the limiting factor in the performance of an application I am developing, according to Visual Studio 2012 Performance Analysis profiler. Is there a faster way to ...
Chris Shouts's user avatar
5 votes
1 answer
3k views

Producing the intersection of several sequences

Based on this SO answer I have created a method that produce the set intersection of several sequences: ...
tigrou's user avatar
  • 421
3 votes
1 answer
188 views

Finding the 'Minimum' AND of all the possible subsets of a set

The subset size should be greater than or equal to 2. How can I speed up this code? ...
murdocc_007's user avatar
7 votes
2 answers
2k views

Using includes() vs. hash function to check if an unordered_set is a subset of another unordered_set

I did two methods to determine if an unordered_set is a subset of another unordered_set, using hashing, and the built-in ...
phoenix's user avatar
  • 73
10 votes
2 answers
2k views

boost::unordered_set intersection using templates

I wrote this function to do unordered_set intersection using templates. I have seen this answer but I thought that it was overkill. I would like the method to take ...
pbible's user avatar
  • 419

15 30 50 per page