Finding max element of an array using two heap-allocated arrays and a bubble sort
-
@gwowen said in Finding max element of an array using two heap-allocated arrays and a bubble sort:
absmax() is not worthy of being a separate function
What if all the values were negative?
-
@xaade what if they were?
-
@jnz said in Finding max element of an array using two heap-allocated arrays and a bubble sort:
@pleegwat said in Finding max element of an array using two heap-allocated arrays and a bubble sort:
And hash tables are pointless because they are only as efficient as the mechanism they use to resolve conflicts.
I've just invented this amazing new hash table that resolves conflicts using ... another hash table! Its O(1) all the way down.
I'm afraid I can't give you more than O(log(n)) for your hash tree.
-
-
@pjh For once, the DMCA being used in a manner that isn't totally shitty.
-
@pjh
Somebody archived a copy before it disappeared: http://archive.fo/PDrPU
-
Still the part that makes me cringe the most:
for(i = 0; i < n; i++) m[i] = i;
Yes, yes, I know,
memcpy
is evil and all that, but holy fuck, if there was ever the time to use it...
-
@onyx said in Finding max element of an array using two heap-allocated arrays and a bubble sort:
Still the part that makes me cringe the most:
for(i = 0; i < n; i++) m[i] = i;
Yes, yes, I know,
memcpy
is evil and all that, but holy fuck, if there was ever the time to use it...How is
memcpy
going to achieve what the loop you've described does?Asking for a friend...
-
@pjh said in Finding max element of an array using two heap-allocated arrays and a bubble sort:
@onyx said in Finding max element of an array using two heap-allocated arrays and a bubble sort:
Still the part that makes me cringe the most:
for(i = 0; i < n; i++) m[i] = i;
Yes, yes, I know,
memcpy
is evil and all that, but holy fuck, if there was ever the time to use it...How is
memcpy
going to achieve what the loop you've described does?Asking for a friend...
Maybe there's some block device you can mmap to get an increasing list of integers!
-
@pjh said in Finding max element of an array using two heap-allocated arrays and a bubble sort:
@onyx said in Finding max element of an array using two heap-allocated arrays and a bubble sort:
Still the part that makes me cringe the most:
for(i = 0; i < n; i++) m[i] = i;
Yes, yes, I know,
memcpy
is evil and all that, but holy fuck, if there was ever the time to use it...How is
memcpy
going to achieve what the loop you've described does?Asking for a friend...
What do you mean ho...
reads the code again
...oh
...
Now my headache is even worse.