12.07.2015 Views

A Practical Introduction to Data Structures and Algorithm Analysis

A Practical Introduction to Data Structures and Algorithm Analysis

A Practical Introduction to Data Structures and Algorithm Analysis

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Sec. 4.1 Lists 113curr... 23 12 ...Insert 10: 10curr(a)... 23 12 ...3101 2Figure 4.9 The linked list insertion process. (a) The linked list before insertion.(b) The linked list after insertion. 1 marks the element field of the new linknode. 2 marks the next field of the new link node, which is set <strong>to</strong> point <strong>to</strong> whatused <strong>to</strong> be the current node (the node with value 12). 3 marks the next field ofthe node preceding the current position. It used <strong>to</strong> point <strong>to</strong> the node containing 12;now it points <strong>to</strong> the new node containing 10.curr(b)...23 10 12(a)...curr2... 23 10 12 ...it1(b)Figure 4.10 The linked list removal process. (a) The linked list before removingthe node with value 10. (b) The linked list after removal. 1 marks the list nodebeing removed. it is set <strong>to</strong> point <strong>to</strong> the element. 2 marks the next field ofthe preceding list node, which is set <strong>to</strong> point <strong>to</strong> the node following the one beingdeleted.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!