- 博客(11)
- 收藏
- 关注
原创 Leetcode 每日一练 (求两个数组的中间值)
思路:将两个数组组成一个数组,将这个数组按照从小到大顺序排列,找出中间值; 代码: void sort(int* x, int n) { int temp=0; for(int i=0; i { for(int j=i+1; j { if(x[i]>x[j]) {
2018-01-11 20:01:57 850
原创 LeetCode每日一练 阿拉伯数字转罗马数字
算法上难度不大,还是找规律; 将个十百千,从1到9的罗马值,存进相应的数组,再根据数值找到对应的罗马值; 以下是程序: #include char* intToRoman(int num) { static char* roman_q[3]={"M","MM","MMM"}; static char* roman_b[9]={"C","CC","CCC","CD","
2018-01-09 19:59:54 215
原创 leetcode----zigzag排列(将字符串按照锯齿形排列C编程)
例子: "PAYPALISHIRING" 排列成锯齿形为: P A H N A P L S I I G Y I R 输出字符串为:"PAHNAPLSIIGYIR". 算法上没什么太大难度,主要是需要找出规律:假设需要排列成5行 0 8 16 1 7 9 15
2018-01-02 20:05:20 485
原创 最长回文子串----leetcode每日一练
第一次: void checkstr(char* x, int y, int z, int* start, int* max) { int i = y, j = z; int length = 0; while(i>=0 && j { i--; j++; } length = j-i-1;
2017-12-15 20:11:44 130
转载 机器学习十大经典算法
1、C4.5 机器学习中,决策树是一个预测模型;他代表的是对象属性与对象值之间的一种映射关系。树中每个节点表示某个对象,而每个分叉路径则代表的某个可能的属性值,而每个叶结点则对应从根节点到该叶节点所经历的路径所表示的对象的值。决策树仅有单一输出,若欲有复数输出,可以建立独立的决策树以处理不同输出。 从数据产生决策树的机器学习技术叫做决策树学习, 通俗说就是决策树。 决策树学习也是数据挖掘中一
2017-12-11 16:13:42 296
原创 Longest Substring Without Repeating Characters
Examples: Given "abcabcbb", the answer is "abc", which the length is 3. Given "bbbbb", the answer is "b", with the length of 1. Given "pwwkew", the answer is "wke", with the length of 3. Note that
2017-12-08 18:04:22 100
原创 spoken language processing 总结概要
绪论总结:语音处理三大技术:1.语音识别; 2.文本语音转换; 3.语音理解; 章节一: a.语言框架:1.规定了人耳可以接受的语音能量范围以及频率与能量之间的关系;2. 语音的产生以及人耳感知系统构造;3.频域与bark域和Mel域之间的转换;3.人耳掩蔽效应(噪音掩蔽语音门限和语音掩蔽噪音门限); b.语音学和音韵学介绍(语言
2017-12-08 10:57:58 2352
原创 Add Two Numbers
sigle list: Add Two Numbers /** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */ struct ListNode* addTwoNumbers(struct ListN
2017-12-07 09:30:15 100
原创 Roman to Integer
my answer: int search(char x) { switch(x) { case 'I': return 1; case 'V': return 5; case 'X': return 10; case 'L': return 50; case 'C': r
2017-12-07 09:27:04 94
原创 LeetCode:Palindrome Number(回文判断)
bool isPalindrome(int x) { int temp, temp1; temp = 1e+9; bool flag = true; if(x return false; if(x return true; while(temp) { if(x / tem
2017-12-07 09:23:36 141
原创 Leetcode Reverse Integer
Assume we are dealing with an environment which could only hold integers within the 32-bit signed integer range. For the purpose of this problem, assume that your function returns 0 when the reversed
2017-12-07 09:21:41 136
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人