![](https://img-blog.csdnimg.cn/20190124185140158.jpeg?x-oss-process=image/resize,m_fixed,h_224,w_224)
数据结构与算法
基础数据结构与算法、LeetCode、ACM、趣味算法以及面试算法等
开发者如是说
这个作者很懒,什么都没留下…
展开
-
数据结构与算法回顾-2:排序算法小结
在下面的排序算法中会使用到的方法: protected static void exchange(Comparable[] arr, int fromPos, int toPos) { Comparable temp = arr[fromPos]; arr[fromPos] = arr[toPos]; arr[toPos] = temp; ...原创 2019-02-25 23:48:49 · 243 阅读 · 0 评论 -
数据结构与算法回顾-1:算法的度量和基本数据结构
1、数据结构 数据结构是相互之间存在一种或多种关系的数据的集合。 1.1 三要素 数据结构三要素是:1.数据的逻辑结构;2.数据的物理结构;3.数据的运算。 数据结构是相互之间存在一种或多种特定关系的数据元素的集合。 1.1.1 逻辑结构 分为线性结构和非线性结构, 线性结构:线性表、栈、队列 非线性结构:树、图、集合 1.1.2 存储结构 即物理结构,分四种(存储数据时不只要存储元素的值...原创 2019-02-25 23:33:04 · 254 阅读 · 0 评论 -
LeetCode-Easy-021-Merge Two Sorted Lists
描述 Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Example: Input: 1->2->4, 1->3->4 Output: 1-...原创 2019-01-25 00:58:25 · 556 阅读 · 0 评论 -
LeetCode-Easy-020-Valid Parentheses
描述 Given a string containing just the characters ‘(’, ‘)’, ‘{’, ‘}’, ‘[’ and ‘]’, determine if the input string is valid. An input string is valid if: Open brackets must be closed by the same type of ...原创 2019-01-25 00:14:32 · 546 阅读 · 0 评论 -
LeetCode-Easy-014-Longest Common Prefix
描述 Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string “”. Example 1: Input: ["flower","flow","flight"] Output: ...原创 2019-01-24 23:56:53 · 552 阅读 · 0 评论 -
LeetCode-Easy-013-Roman to Integer
描述 Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100 D ...原创 2019-01-24 19:16:30 · 584 阅读 · 0 评论 -
LeetCode-Easy-009-Palindrome Number
描述 Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Example 1: Input: 121 Output: true Example 2: Input: -121 Output: false Explana...原创 2019-01-24 18:44:26 · 578 阅读 · 0 评论 -
LeetCode-Easy-007-Reverse-integer
描述 Given a 32-bit signed integer, reverse digits of an integer. Example 1: Input: 123 Output: 321 Example 2: Input: -123 Output: -321 Example 3: Input: 120 Output: 21 Note: Assume we are dealing wi...原创 2019-01-24 12:52:05 · 595 阅读 · 0 评论 -
LeetCode-Easy-001-Two sum
描述 Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the sam...原创 2019-01-24 12:40:03 · 565 阅读 · 1 评论