摘要: type MyStack struct { queue []int } /** Initialize your data structure here. */ func Constructor() (s MyStack) { return } /** Push element x onto stac 阅读全文
posted @ 2022-03-20 15:13 ☞@_@ 阅读(8) 评论(0) 推荐(0) 编辑
摘要: type MyQueue struct { inStack, outStack []int } func Constructor() MyQueue { return MyQueue{} } func (q *MyQueue) Push(x int) { q.inStack = append(q.i 阅读全文
posted @ 2022-03-20 14:14 ☞@_@ 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 反转整个链表 /** * Definition for singly-linked list. * type ListNode struct { * Val int * Next *ListNode * } */ func reverseList(head *ListNode) *ListNode 阅读全文
posted @ 2022-03-20 11:18 ☞@_@ 阅读(26) 评论(0) 推荐(0) 编辑