bisection

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtremeValueOfRotateArray

type ExtremeValueOfRotateArray struct {
}

*

  • @author ljfirst
  • @version V1.0
  • @date 2023/7/10 00:14
  • @author-Email ljfirst@mail.ustc.edu.cn
  • @blogURL https://blog.csdn.net/ljfirst
  • @description 求有序数组旋转后的极值(最大值、最小值)
  • 一个有序递增数组,比如[1,2,3,4,5,6,7],后面部分被替换到前面,比如[5,6,7,1,2,3,4],找出替换后的数组的最大值
  • 一个有序递增数组,比如[1,2,3,4,5,6,7],后面部分被替换到前面,比如[5,6,7,1,2,3,4],找出替换后的数组的最小值 *

func (*ExtremeValueOfRotateArray) GetAttribute

func (m *ExtremeValueOfRotateArray) GetAttribute() *C.Attribute

func (*ExtremeValueOfRotateArray) Method

func (m *ExtremeValueOfRotateArray) Method(array []int, getBigger bool) int

attention : 1、找最大值,需要对比的值是 array[left],找最小值,需要对比的值是 array[right]

2、对比结束的 else ,即相等的时候,是需要return的

type TargetValueOfRotateArray

type TargetValueOfRotateArray struct {
}

*

  • @author ljfirst
  • @version V1.0
  • @date 2023/7/10 00:14
  • @author-Email ljfirst@mail.ustc.edu.cn
  • @blogURL https://blog.csdn.net/ljfirst
  • @description 求有序数组旋转后的给定值
  • 一个有序递增数组,比如[1,2,3,4,5,6,7],后面部分被替换到前面,比如[5,6,7,1,2,3,4],找出替换后的数组的给定值 位置 *

func (*TargetValueOfRotateArray) GetAttribute

func (m *TargetValueOfRotateArray) GetAttribute() *C.Attribute

func (*TargetValueOfRotateArray) Method

func (m *TargetValueOfRotateArray) Method(array []int, target int) int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL