Daniel
Sapoundjiev on
Reverse double linked list Reverse double linked listQuick change of the directionAboutFor many algorithms its easier to work with polygons that are counterclockwise. What algorithm people usually useThe most common algorithm for reversing the double linked list looks like this in java language Point point = list.first; We assume that the linked list is cycling one. Otherwise in the condition have to compare to null Here is my faster onePoint point = list.first; The number of cycles are the same. Also the used variables are the same. But there is one assignment less for every cycle. So, that's the fastest for now! Back to main menu |