摘要: package main import ( "fmt" ) func InsertSort(arr *[6]int) { for i := 1; i = 0 && arr[index] > val { arr[index+1] = arr[index] index-- } if index + 1 == i { continue } arr[index+... 阅读全文
posted @ 2018-12-08 01:36 kosa 阅读(721) 评论(0) 推荐(0)
摘要: package main import ( "fmt" ) func BubbleSort(arr *[5]int) { for i := 0; i arr[j] { arr[i], arr[j] = arr[j], arr[i] } } } } func main() { arr := [5]int{1,43,5,94,90} BubbleSort(&arr... 阅读全文
posted @ 2018-12-08 01:35 kosa 阅读(218) 评论(0) 推荐(0)
摘要: package main import ( "fmt" ) //假设是一群小孩在玩这个游戏 //创建一个小孩的结构体 type BoyNode struct { No int //给每个小孩一个唯一的身份编号 next *BoyNode //指向下一个小孩 } //假设有number个小孩在玩游戏 func AddBoyNode(number int) *BoyNode { he... 阅读全文
posted @ 2018-12-07 16:35 kosa 阅读(331) 评论(0) 推荐(0)
摘要: package main import ( "fmt" ) //环形链表测试用结构体 type TestNode struct { no int //编号 name string //姓名 next *TestNode } //环形链表插入 func InsertNod(head *TestNode, newNode *TestNode) { if head.next == ... 阅读全文
posted @ 2018-12-07 13:44 kosa 阅读(553) 评论(0) 推荐(0)
摘要: package main import ( "fmt" ) //双链表结构 type TwoLinkTable struct { no int name string pre *TwoLinkTable next *TwoLinkTable } //直接在队尾插入 func InsertNode(head *TwoLinkTable, newNode *TwoLinkTable... 阅读全文
posted @ 2018-12-06 16:23 kosa 阅读(300) 评论(0) 推荐(0)
摘要: package main import ( "fmt" ) type LinkNode struct { no int //编号 name string //姓名 next *LinkNode } //直接在队尾插入 func InsertNode(head *LinkNode, newNode * 阅读全文
posted @ 2018-12-04 18:06 kosa 阅读(722) 评论(0) 推荐(0)
摘要: 1 package main 2 3 import ( 4 "fmt" 5 "errors" 6 "os" 7 ) 8 9 //管理环形队列的结构 10 type Queue struct { 11 maxSize int 12 array [5]int 13 head int 14 tai... 阅读全文
posted @ 2018-12-03 16:58 kosa 阅读(1026) 评论(0) 推荐(0)
摘要: 1 class Page: 2 def __init__(self,list_count,current_page,page_list_num=10,page_num=7): 3 #总条数 4 self.list_count = list_count 5 #每页显示的数据条数 6 self.page 阅读全文
posted @ 2018-03-01 20:10 kosa 阅读(272) 评论(0) 推荐(0)