摘要:
leetcode -Move ZeroesGiven an arraynums, write a function to move all0's to the end of it while maintaining the relative order of the non-zero element... 阅读全文
摘要:
leetcode -Ugly NumberWrite a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only incl... 阅读全文
摘要:
leetcode -Sort ColorsGiven an array withnobjects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors... 阅读全文
摘要:
leetcode -Product of Array Except SelfGiven an array ofnintegers wheren> 1,nums, return an arrayoutputsuch thatoutput[i]is equal to the product of all... 阅读全文
摘要:
STL 容器顺序容器vector 内存连续,两倍增长deque 内存小片连续,链表相连。 双端队列。list 内存不连续。 双向链表。关联容器map 红黑树实现set 红黑树实现容器适配器queue 队列。先入先出 在deque基础上封装;stack 栈。 先进后出 在deque基础上封装;prio... 阅读全文
摘要:
leetcode -Convert Sorted Array to Binary Search TreeGiven an array where elements are sorted in ascending order, convert it to a height balanced BST./... 阅读全文
摘要:
leetcode -Valid AnagramGiven two stringssandt, write a function to determine iftis an anagram ofs.For example,s= "anagram",t= "nagaram", return true.s... 阅读全文
摘要:
leetcode -Invert Binary Treenvert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1/** * Defini... 阅读全文
摘要:
leetcode - Lowest Common Ancestor of a Binary Search TreeGiven a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in... 阅读全文
摘要:
leetcode -Minimum Path SumGiven amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numb... 阅读全文