dsa1 min read
Find the Duplicate Number — Floyd's on Array as Linked List
Find the duplicate in an array of n+1 integers in O(1) space by treating indices as a linked list with Floyd's cycle detection.
Read →
webcoderspeed.com
2 articles
Find the duplicate in an array of n+1 integers in O(1) space by treating indices as a linked list with Floyd's cycle detection.
Build a balanced BST from a sorted list in O(n) by counting nodes, building in-order, and consuming list nodes.