Originally posted by Hauldren Collider
View Post
Announcement
Collapse
No announcement yet.
Programming question
Collapse
X
-
If LinkedList is a simple shim over an array, I'd personally strangle James Gosling next time I see him."The issue is there are still many people out there that use religion as a crutch for bigotry and hate. Like Ben."
Ben Kenobi: "That means I'm doing something right. "
-
Well it's just a few references actually, it isn't really a shim over anything I guess, but there's really not much to it.Originally posted by Kuciwalker View PostUh, what is LinkedList supposed to be a shim over?
This is from memory so if someone actually gets the documentation I'll probably have details wrong but my recollection is it's basically just
Linked List:
-ListNode head
methods
ListNode:
ListNode next
ListNode previous
{whatever the generic object thingy is in Java} value
methods
And it implements all the interfaces.If there is no sound in space, how come you can hear the lasers?
){ :|:& };:
Comment
-
Well, my knowledge about java isn't that good - my main experience of it is customisable (?) functions for data validation, and there a couple of miliseconds doesn't matter much.Originally posted by Hauldren Collider View PostOverhead of this kind is not really an issue in Java as it's running in a VM anyways and the overhead of function calls is so minute.
My main argument is when you have to deal with large amounts of data, and there I would never use java.With or without religion, you would have good people doing good things and evil people doing evil things. But for good people to do evil things, that takes religion.
Steven Weinberg
Comment
-
Do you understand how a linked list works and why it would not make sense to build it around an array?Originally posted by Hauldren Collider View PostWell it's just a few references actually, it isn't really a shim over anything I guess, but there's really not much to it.
This is from memory so if someone actually gets the documentation I'll probably have details wrong but my recollection is it's basically just
Linked List:
-ListNode head
methods
ListNode:
ListNode next
ListNode previous
{whatever the generic object thingy is in Java} value
methods
And it implements all the interfaces."The issue is there are still many people out there that use religion as a crutch for bigotry and hate. Like Ben."
Ben Kenobi: "That means I'm doing something right. "
Comment
-
Yes. Jesus christ asher, you're acting like I'm some dumb kid...Originally posted by Asher View PostDo you understand how a linked list works and why it would not make sense to build it around an array?
oh wait. ****.
HOWEVER: If you want a definition
A linked list is a list where the values are stored anywhere in memory and are connected to each other by reference, such that each node has a reference to the next node and to the previous node for doubly-linked lists. This allows O(1) insertion but requires O(N) lookup time. Do not try to binary search a linked list. A classmate did that. We laughed at him.If there is no sound in space, how come you can hear the lasers?
){ :|:& };:
Comment
-
Self deprecating humor is how I keep the attention of the class of sorts I teach about systems administration at school AND SO FAR THIS YEAR EVERY SINGLE CLASS HAS HAD MORE GIRLS COME TO IT THAN THE LAST*Originally posted by Wiglaf View PostSelf deprecation gets you nowhere in life. Do you think self defecation is how I get women/jobs/anything? Everyone wants a confident man

*AND NOT ALL OF THEM LOOK HIDEOUSLY DISFIGUREDIf there is no sound in space, how come you can hear the lasers?
){ :|:& };:
Comment
-
FWIW, it's my experience that ArrayList is 25-33% slower than Arrays for things like iterating.
In Java, a "foreach" low is MUCH slower than a traditional for loop due to the construction of iterators. Awful design."The issue is there are still many people out there that use religion as a crutch for bigotry and hate. Like Ben."
Ben Kenobi: "That means I'm doing something right. "
Comment
-
Good to see that you actually agree with meOriginally posted by Kuciwalker View PostThat said, if you care about the performance you can just write the normal for loop.
With or without religion, you would have good people doing good things and evil people doing evil things. But for good people to do evil things, that takes religion.
Steven Weinberg
Comment
-
In C I just use the goto's for efficiency, much faster that way.
The method calls are too slow as well, so I just goto inside methods.
I heard about this loop unrolling thing but it sounded like some toilet paper related activity and ever since my car was covered in toilet paper I have a crippling fear of it.If there is no sound in space, how come you can hear the lasers?
){ :|:& };:
Comment
-
Nah, goto is for children - try experiment with longjmp that can really mess things up
With or without religion, you would have good people doing good things and evil people doing evil things. But for good people to do evil things, that takes religion.
Steven Weinberg
Comment
-
Holy **** you are dumb. You can write a normal for loop over an ArrayList just fine. It is using the syntactic sugar intended for things that can't be treated as arrays that, guess what, aren't optimal for use with things that act exactly like arrays.Originally posted by BlackCat View PostGood to see that you actually agree with me
Comment
that's terrible
Comment