🗒️数据结构

Agoinnnnnn

|2024-9-4|Last edited: 2024-9-18|
type
status
date
slug
summary
tags
category
icon
password

二分查找

右移左移

8(0000 1000)>>>1 → 4(0000 0100)右移一位的意思就是除二

二分查找相同元素时,返回相同值最左侧的下标

返回相同值最左侧的下标
在求一个数在数组里的排名时,可以使用leftmost;求前任也用leftmost;求后任就用rightmost