Pseudo-code

Dec
28th

Doubly Linked List – Delete Middle Without Counting

This was an exercise from one of my CS classes. The middle of a list is one record with equal number of records to the left and right (assuming the list has odd number of elements). If this number is even, the middle consists of two records. Write a pseudo-code procedure to delete the middle (one or two) record(s) of a doubly linked list without counting first or knowing the total number of elements in the list.

Continue reading »

Posted in Data Structures & Algorithms, Pseudo-code | Leave a comment
Tags:
Dec
28th

Reverse a Doubly Linked List

This was an exercise from one of my CS classes. How do you reverse a doubly linked list? Seems like this is a common question, so I figured I’d post the solution.

Continue reading »

Posted in Data Structures & Algorithms, Pseudo-code | Leave a comment
Tags: