給定一個(gè)鏈表,兩兩交換其中相鄰的節(jié)點(diǎn),并返回交換后的鏈表。 你不能只是單純的改變節(jié)點(diǎn)內(nèi)部的值,而是需要實(shí)際的進(jìn)行節(jié)點(diǎn)交換。 示例: 給定 1->...
題目描述: 給定一個(gè)單鏈表,其中的元素按升序排序,將其轉(zhuǎn)換為高度平衡的二叉搜索樹。 本題中,一個(gè)高度平衡二叉樹是指一個(gè)二叉樹每個(gè)節(jié)點(diǎn) 的左右兩個(gè)...
簡(jiǎn)介:golint是go語言中用于檢測(cè)代碼規(guī)范的工具。 一、下載golint源碼 mkdir -p $GOPATH/src/golang.org...
Given a non-empty, singly linked list with head node head, return a midd...
Given a sorted linked list, delete all duplicates such that each element...
Merge two sorted linked lists and return it as a new list. The new list ...
Reverse a singly linked list. Example: Input: 1->2->3->4->5->NULLOutput:...
Write a function to delete a node (except the tail) in a singly linked l...
Design your implementation of the linked list. You can choose to use the...