Difference between revisions of "TADM2E 3-6"

From Algorithm Wiki
Jump to: navigation, search
(Created page with "Modify ''insert'' and ''delete'': Pointers to successor and predecessor can be found in O(log n) time upon insertion. Store these in the Node. predecessor(void * pcNode) and s...")
 
 
Line 1: Line 1:
 
Modify ''insert'' and ''delete'':
 
Modify ''insert'' and ''delete'':
Pointers to successor and predecessor can be found in O(log n) time upon insertion. Store these in the Node. predecessor(void * pcNode) and successor(void * pcNode) take O(1). Upon deletion of Node, successor of the predecessor becomes the predecessor of the successor.
+
Pointers to successor and predecessor can be found in O(log n) time upon insertion. Store these in the new Node. predecessor(void * pcNode) and successor(void * pcNode) take O(1). Upon deletion of Node, successor of the predecessor becomes the predecessor of the successor.

Latest revision as of 00:04, 22 July 2018

Modify insert and delete: Pointers to successor and predecessor can be found in O(log n) time upon insertion. Store these in the new Node. predecessor(void * pcNode) and successor(void * pcNode) take O(1). Upon deletion of Node, successor of the predecessor becomes the predecessor of the successor.