Implemented constant time for subpath operations.