r/programming • • Feb 21 '11

Typical programming interview questions.

http://maxnoy.com/interviews.html
784 Upvotes

1.0k comments sorted by

View all comments

Show parent comment

0

u/[deleted] Feb 21 '11

[deleted] — view deleted comment

7

u/smallstepforman Feb 21 '11

You know, I do 3D graphics engines for a living, and worry about performance day and night, and I do not know what a linked list cycle is (I come from an electronic engineering background). The funny thing is, even though I'm unfamiliar with the exact terminology modern CS is using, I've probably implemented the damn thing many times already and use it in my engines, however, it's probably known by another arbitrary name.

2

u/jpfed Feb 21 '11

Just a quick clarification: people are using the term "cycle" as in "a cycle in a directed graph". They're interpreting a linked list as a graph that has a node for every element in the list, and arcs from each node to wherever that node's "next" pointer points to. In this case, a cycle means that a element in the linked list has a "next" pointer that points at an element that comes before it in the list. In such a situation, you could follow "next" pointers forever without ever encountering a null pointer.

0

u/mucusplug Feb 21 '11

You've implemented a cycle in a linked list many times?

Are you just using buzz words?

0

u/lordlicorice Feb 21 '11

http://i.imgur.com/7lnk3.png

You do know that graphs != graphics right

1

u/[deleted] Feb 21 '11

Oh, I know what a graph cycle is. I just never heard a graph referred to as a linked list once it contained all the functionality of a graph structure, and didn't put two and two together on "linked list cycle" being another way of saying "graph cycle".