
数据结构和算法
大熊弋
FE爱好者,从业者
展开
-
LeetCode系列之——3. Longest Substring Without Repeating Characters(JavaScript)
Q:题目链接:Longest Substring Without Repeating Characters 先看题目要求: Given a string, find the length of the longest substring without repeating characters.Examples:Given “abcabcbb”, the answer is “abc”, whi原创 2018-01-31 14:40:39 · 506 阅读 · 0 评论 -
LeetCode系列之——1. Two Sum(JavaScript)
Q:题目链接: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, an原创 2018-01-23 01:01:52 · 460 阅读 · 0 评论 -
LeetCode系列之——2. Add Two Numbers(JavaScript)
Q:题目链接:Add Two Numbers 先看题目要求: You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digi原创 2018-01-25 00:33:59 · 651 阅读 · 0 评论 -
排序算法总结(Javascript版本)
最近想系统地看看数据结构和算法,虽然实际工作中用到的不多(也许是水平不够不知道要用...),但还是要多培养这方面的意识和思想,再加上大厂面试基本都要考察数据结构和算法,所以还是要把这块捡起来。当然,还是先从排序走起。上一次系统地看排序还是在大学里,刚接触编程不久,当时还是用C和Java写的,如今做了前端,C和Java几年不看也丢得差不多了,只能写写JS了。1.冒泡排序实现原理原创 2018-01-09 21:51:44 · 230 阅读 · 0 评论 -
LeetCode系列之——5. Longest Palindromic Substring(JavaScript)
Q:题目链接:Longest Palindromic Substring 先看题目要求: Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example1:Input: “babad”Output:原创 2018-02-05 14:31:10 · 249 阅读 · 0 评论 -
LeetCode系列之——15. 3Sum(JavaScript)
Q:题目链接:3Sum 先看题目要求: Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note: The solution set原创 2018-02-26 18:37:29 · 655 阅读 · 0 评论 -
LeetCode系列之——6. ZigZag Conversion
Q:题目链接:ZigZag Conversion 先看题目要求: The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better le原创 2018-02-07 17:20:12 · 222 阅读 · 0 评论 -
LeetCode系列之——14. Longest Common Prefix(JavaScript)
Q:题目链接:Longest Common Prefix 先看题目要求: Write a function to find the longest common prefix string amongst an array of strings. 有一个字符串数组,写一个函数找出最长的通用字符串前缀。比如输入[‘abc’,’abd’,’a’,’ac’],输出’a’。分析 开始在想有没原创 2018-02-16 21:35:33 · 557 阅读 · 0 评论 -
LeetCode系列之——7. Reverse Integer/9. Palindrome Number(JavaScript)
Q:题目链接:Reverse Integer和Palindrome Number 先看题目要求: Reverse Integer: Palindrome Number: 分析 看完题目要求,大家估计就知道为什么把这两个题目放到一起了,都是有关回文数字的题目。题目都不难,主要注意下题目要求,第七题要求出参是32位整型,如果不是,返回0(这个在javascript中貌似没有多大意义原创 2018-02-08 18:14:25 · 323 阅读 · 0 评论