数据结构
小鹏残月
记录自己的成长
展开
-
leetcode insertionSortList
描述: Sort a linked list using insertion sort.使用插入排序对一个链表进行排序普通的插入排序,时间复杂度O(n^2)class Solution {public: ListNode * insertionSortList(ListNode * head) { ListNode dummy(0); ListNode原创 2017-07-30 13:17:19 · 281 阅读 · 0 评论 -
LeetCode-EvaluteReversePolishNotation
题目: Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or another expression.Some examples: ["2", "1", "+"原创 2017-07-17 00:33:25 · 178 阅读 · 0 评论 -
LeetCode-MinimumDepthOfBinaryTree
题目: Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node./** * Definition for a binary t原创 2017-07-16 22:48:45 · 219 阅读 · 0 评论