Documentation
¶
Index ¶
- func Num01MethodOne(target int, arr [][]int) bool
- func Num01MethodTwo(target int, arr [][]int) bool
- func Num02MethodOne(str string) string
- func Num03MethodOne(node *ds.LinkNode) *ds.LinkNode
- func Num03MethodTwo(node *ds.LinkNode) *ds.LinkNode
- func Num04MethodOne(preOrder, midOrder []int) (root *ds.BTree)
- func Num06MethodOne(arr []int) int
- func Num07MethodOne(num int) int
- func Num07MethodTwo(num int) int
- func Num08MethodOne(num int) int
- func Num08MethodTwo(num int) int
- func Num09MethodOne(num int) int
- func Num09MethodTwo(num int) int
- func Num10MethodOne(num int) int
- func Num10MethodTwo(num int) int
- func Num11MethodOne(num uint32) int
- func Num11MethodTwo(num uint32) int
- func Num12MethodOne(base float64, exponent int) float64
- func Num13MethodOne(arr []int) []int
- func Num13MethodThree(arr []int) []int
- func Num13MethodTwo(arr []int) []int
- func Num14MethodOne(head *ds.LinkNode, k int) *ds.LinkNode
- func Num16MethodOne(l1, l2 *ds.LinkNode) *ds.LinkNode
- func Num17MethodOne(a, b *ds.BTree) bool
- func Num18MethodOne(root *ds.BTree) *ds.BTree
- func Num18MethodTwo(root *ds.BTree) *ds.BTree
- func Num19MethodOne(matrix [][]int) []int
- func Num21MethodOne(pushed, popped []int) bool
- func Num22MethodOne(root *ds.BTree) []int
- func Num23MethodOne(postorder []int) bool
- func Num24MethodOne(root *ds.BTree, target int) [][]int
- func Num25MethodOne(root *ds.RandomListNode) *ds.RandomListNode
- func Num26MethodOne(root *ds.BTree) *ds.BTree
- func Num27MethodOne(str string) []string
- func Num28MethodOne(nums []int) int
- func Num29MethodOne(nums []int, k int) []int
- func Num30MethodOne(nums []int) int
- func SelectSort(data []int) int
- type ArrayStack
- type MinStack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Num02MethodOne ¶
func Num04MethodOne ¶
func Num06MethodOne ¶
func Num07MethodOne ¶
func Num07MethodTwo ¶
func Num08MethodOne ¶
func Num08MethodTwo ¶
func Num09MethodOne ¶
func Num09MethodTwo ¶
func Num10MethodOne ¶
func Num10MethodTwo ¶
func Num11MethodOne ¶
func Num12MethodOne ¶
func Num13MethodOne ¶
func Num14MethodOne ¶
利用快慢指针的思想。将第一个指针 fast 指向链表的第 k + 1 个节点,第二个指针 slow 指向链表的第一个节点,此时指针 fast 与 slow 之间刚好间隔 k 个节点。此时两个指针同步向后走,当第一个指针 fast 走到链表的尾部空节点时,则此时 slow 指针刚好指向链表的倒数第 k 个节点。
func Num17MethodOne ¶
func Num18MethodTwo ¶
二叉树先进行递归遍历,找到叶子节点,回溯的过程中进行左右子树交换操作。
func Num19MethodOne ¶
func Num21MethodOne ¶
解题思路 1,本题主要考察入栈出栈的理解 2,golang slice可以很容易实现栈 3,每次pushed入栈后popped 进行比较 4,如果栈非空,且poped的当前元素和栈顶元素相等,则出栈,同时右移popped指针
func Num23MethodOne ¶
二叉搜索树的后序遍历序列 从上往下打印出二叉树的每个节点,同层节点从左至右打印。
根节点的值大于左子树小于右子树 后序遍历: 左子树 -> 右子树 -> 根节点
func Num25MethodOne ¶
func Num25MethodOne(root *ds.RandomListNode) *ds.RandomListNode
func Num27MethodOne ¶
func Num28MethodOne ¶
func Num29MethodOne ¶
func Num30MethodOne ¶
func SelectSort ¶
Types ¶
type ArrayStack ¶
func (*ArrayStack) Pop ¶
func (stack *ArrayStack) Pop() string
func (*ArrayStack) Push ¶
func (stack *ArrayStack) Push(val string)
type MinStack ¶
func Constructor ¶
func Constructor() MinStack
Source Files
¶
Click to show internal directories.
Click to hide internal directories.