Implement node reference updates in better big-O complexity.