- 博客(8)
- 收藏
- 关注
原创 203. Remove Linked List Elements
Remove all elements from a linked list of integers that have valueval. Example: Input: 1->2->6->3->4->5->6, val = 6 Output: 1->2->3->4->5 /** * Definition for ...
2020-05-05 16:02:18 120
原创 8. String to Integer (atoi)
Implement atoi whichconverts a string to an integer. The function first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starting from thi...
2020-05-05 16:00:37 92
原创 7. 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 with...
2019-12-16 14:00:42 95
原创 5. 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. Example 1: Input: "babad" Output: "bab" Note: "aba" is also a valid answer. Exampl...
2019-12-13 18:34:39 105
原创 3. Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters. Example 1: Input: "abcabcbb" Output: 3 Explanation: The answer is "abc", with the length of 3. Example 2: In...
2019-12-13 14:32:27 86
原创 2. 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 digit. Add the two numbers and return i...
2019-11-07 17:05:14 79
原创 1. Two sum
题目描述 给定一个整型数组,要求返回两个数的下标,使得两数之和等于给定的目标值,要求同一个下标不能使用两次。 数据保证有且仅有一组解。 样例 给定数组 nums = [2, 7, 11, 15],以及目标值 target = 9, 由于 nums[0] + nums[1] = 2 + 7 = 9, 所以 return [0, 1]. 算法1: (暴力枚举)O(n^2) 使用两个循环实...
2019-11-06 16:44:03 137
原创 机器学习实战 笔记一:kNN分类算法
开发机器学习应用程序的步骤: 1、收集数据 2、准备输入数据 3、分析输入数据 4、训练算法 5、测试算法 6、使用算法 第一个算法:k-近邻算法 k-近邻算法的一般流程: 1、收集数据:可以使用任何方法 2、准备数据:距离计算所需要的数值,最好是结构化的数据格式,此时需要对数据进行格式化 3、分析数据:可以使用任何方法 4、训练算法:此步骤不适合用于k-近
2017-03-23 20:41:43 342
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人