EvgenyKarkan / EKAlgorithms

EKAlgorithms contains some well known CS algorithms & data structures.
MIT License
2.42k stars 362 forks source link

Better count of occurrences of each element in array (#40, #41). #42

Closed stanislaw closed 10 years ago

stanislaw commented 10 years ago

Howdy!

I've added SpecHelpers.h with benchmark method. For example, you may use it to compare how both methods perform:

// create originalArray (like it is done in specs)
benchmark(100, ^{
    NSDictionary *result = [originalArray occurencesOfEachElementInArrayByUsingDictionary];

    NSLog(@"Result is %@", result);
});

benchmark(100, ^{
    NSDictionary *result = [originalArray occurencesOfEachElementInArray];

    NSLog(@"Result is %@", result);
});
stanislaw commented 10 years ago

Oh, I see these wrong indents again. Sorry for that, I don't know where do they come from - I see this behavior only when working with your EKAlgorithms project. Please, use your plugins to fix that easily.

EvgenyKarkan commented 10 years ago

Hi Stanislaw! It is nice to see you again! Thnx for your help - I've got new skills from every new PR from you. Shame on me for isEqual method :) It was to late at night maybe :)