Skip to main content
CocoCrisp's user avatar
CocoCrisp's user avatar
CocoCrisp's user avatar
CocoCrisp
  • Member for 9 years, 5 months
  • Last seen more than 2 years ago
  • Cork, Ireland
awarded
awarded
awarded
awarded
accepted
comment
Animal Shelter Management C++
Thankyou for briefly explaining! I didn't know much about std::endl as I have just used it in college to break lines but this explanation is really nice! Also, I did not think of the range of int, good point! Virtual destructor, how did I miss that!
awarded
revised
Animal Shelter Management C++
Added a brief description
Loading…
comment
Animal Shelter Management C++
That's why I don't use namespaces, don't know why I did it here @L.F.
revised
Animal Shelter Management C++
Changed printQueue, added headers and namespace
Loading…
revised
Loading…
asked
Loading…
awarded
comment
Matrix multiplication with OpenMP parallel for loop
The default number of threads is the number of cores in your machine!
comment
Finding median from unsorted array with duplicate elements without sorting it
I tried it with random array and I feel it gets stuck in an infinite loop for some inputs. I'll figure out the cases and will post it here
comment
Finding median from unsorted array with duplicate elements without sorting it
Just to keep a note, I was just mad at this, and how can such a simple problem does not have any efficient solution. Torben's Median Algorithm works charm, the main property of this algorithm is, "Bigger the array gets, better the algorithm becomes"! It dosen't sort the array. For odd number of elements, it returns the middle and for even it returns n/2 highest value. There is a slight improvement of this on github for even sized arrays to return actual median! Obviously it's better with O(log(N))
comment
Finding median from unsorted array with duplicate elements without sorting it
Wow! This significantly reduces the time required! Is that O(n)? I used Torben's method earlier which is O(log(N)) but this is even faster and much faster indeed! Can you throw some light on time complexity? I just changed the way to create a frequency array, did not incorporate any changes related to excessive temporary memory.
comment
Finding median from unsorted array with duplicate elements without sorting it
I would surely enjoy an algorithm with O(nlog(n)) but considering the input array I am not very much in favor of using an auxiliary space O(n)