Your Computer Science Resource

Archive for the ‘Pseudo-code’ Category

Dec
28th

Doubly Linked List – Delete Middle Without Counting

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.

(more…)

Dec
28th

Reverse a Doubly Linked List

This question comes up often in undergraduate CS classes, specifically Data Structures and Algorithms: How do you reverse a doubly linked list? Let’s find out! :)

(more…)