【leetcode 658】
solution:binary search+sliding window
1.数组边界
arr[p]:__________ p 在 [0,1,...,len(arr)-1]
arr[pl:pr] : _________ [pl,pl+1,...,pr-1], 共有pr-pl个
2.binary search
2.1: 迭代的div: _________ div=len(arr)/2 --> div=div/2
2.2: div的边界:_________ =max(div/2,1),div要保证下边界为1
3.sliding window的while: __________ while (pr-pl) <k(个数)
【computer architecture】
1. 5 stage in-order pipeline:_______
2.1: data hazard:________
true dependency:_____ RAW
false dependency:______ 1.WAR 2.WAW
solution:_________ 1.OoO 2.data forwarding
2.2: control hazard/branch:______ branch prediction
2.3:structural hazard:________
3.scoreboard:________ dynamic scheduling+ no renaming
4.tomasulo's algorithm:________ copy-based register renaming, full OoO
5.ROB:_______ precise interrupts/exception/abort&restart
【sv】
polymorphism:_________
1.type conversion:_______ 1.1:implicit conversion: x 没赋值,默认0/位宽扩展
1.2.1:static cast:_______ e.g: R=int'(10.5)
1.2.2: dynamic cast:_______
$cast(子,父)
还是得保证父类指向的对象和子类一致,比如说父类handle指向的子类对象
handle 的cast
父=子,父类还是只能访问自己的对象,看不到子类的同名function,除非我们用virtual定义父类
2.virtual function:__________ virtual function 让子可以override 父