摘要:
type MyStack struct { queue []int } /** Initialize your data structure here. */ func Constructor() (s MyStack) { return } /** Push element x onto stac 阅读全文
摘要:
type MyQueue struct { inStack, outStack []int } func Constructor() MyQueue { return MyQueue{} } func (q *MyQueue) Push(x int) { q.inStack = append(q.i 阅读全文
摘要:
反转整个链表 /** * Definition for singly-linked list. * type ListNode struct { * Val int * Next *ListNode * } */ func reverseList(head *ListNode) *ListNode 阅读全文