给定含有n个不同的数的数组 L=<X1,X2.....,Xn>如果 L 中存在Xi(1<i<n)使得x1<x2<....<xi-1<xi>xi+1>...>xn
则称 L 是单峰的,并称 xi 是L 的 “峰顶”。现在已知 L 是单峰的,请把 a-c 三行代码补全到算法中使得算法 正确找到 L 的峰顶。
a.Search(k+1, n)
b.Search(1, k-1)
c.return L[k]
Search(1, n)
1.k← [n/2]
2.if L[k] > L[k-1] and L[k] > L[k+1]
3.then __________
4.else if L[k] > L[k-1] and L[k] < L[k+1]
5.then __________
6.else __________
b.Search(1, k-1)
c.return L[k]
Search(1, n)
1.k← [n/2]
2.if L[k] > L[k-1] and L[k] > L[k+1]
3.then __________
4.else if L[k] > L[k-1] and L[k] < L[k+1]
5.then __________
6.else __________
正确的填空顺序是( )。