- 博客(53)
- 收藏
- 关注
原创 麦克风阵列一
麦克风阵列处理的研究主要包括声源定位、语音增强、音源分离、去混响以及鸡尾酒会效应。麦克风阵列较单麦克风在时域和频域的基础上增加了空域,可对空间来之不同方向的信号进行空时频联合处理,弥补单麦克风在去噪,定位,音源分离的等方面的不足。一、声源定位:利用空间分布的多路麦克风拾取声音信号,通过麦克风阵列的各路输出信号来估计声源空间位置。声源定位的方法包括波束成形、超分辨谱估计以及TDOA法。这
2017-03-18 15:47:20
4454
原创 2016迅雷校园招聘笔试题(1)
生命游戏Time Limit: 1000/1000 MS (Java/Others) Memory Limit:65536/65536 K (Java/Others)Problem Description:生命游戏是英国数学家约翰·何顿·康威在1970年发明的细胞自动机。这是一个零玩家游戏,它包括一个无限大的二维矩形世界,这个世界是由无数小的方格组成。每个方格中居住着一个活着的或死了的细胞
2015-09-24 23:42:24
1423
原创 leetcode: (137) Single Number II
【Question】Given an array of integers, every element appears three times except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implemen
2015-09-24 23:35:23
327
原创 leetcode: (260) Single Number III
【Question】Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once.For exam
2015-09-24 01:17:20
365
原创 leetcode: (141) Linked List Cycle
【Question】Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?无环的话,必定最后一个节点指向NULL。有环的话,肯定会指向前面的节点。这一个不动步长的节点,一个每次移动一个节点,另一个每次移动两
2015-09-23 22:55:12
326
原创 leetcode: (283) Move Zeroes
【Question】Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.For example, given nums = [0, 1, 0, 3, 12], aft
2015-09-23 12:48:58
352
原创 leetcode: (70) Climbing Stairs
【Question】You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?可以发现规律nums[n
2015-09-18 18:08:28
308
原创 leetcode: (153) Find Minimum in Rotated Sorted Array
【Question】Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).Find the minimum element.You may assume no dupl
2015-09-11 19:31:56
223
原创 leetcode: (122) Best Time to Buy and Sell Stock II
【Question】Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions as you
2015-09-11 08:26:34
225
原创 leetcode: (206) Reverse Linked List
【Question】Reverse a singly linked list.借助一个辅助指针来保存当前指针的后一个节点,遍历一次即可/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) :
2015-09-08 22:44:16
262
原创 leetcode: (121) Best Time to Buy and Sell Stock
【】Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the
2015-09-06 22:10:43
268
原创 leetcode: (35) Search Insert Position
【Question】Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates
2015-09-06 13:22:30
270
原创 leetcode: (94) Binary Tree Inorder Traversal
【Question】Given a binary tree, return the inorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,3,2].Note: Rec
2015-09-05 23:08:23
273
原创 leetcode: (41) Populating Next Right Pointers in Each Node
【Question】Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointer to point to its n
2015-09-05 21:20:38
350
原创 leetcode: (144) Binary Tree Preorder Traversal
【Question】Given a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,2,3].Note:
2015-09-05 18:22:24
280
原创 leetcode: (226) Invert Binary Tree
【Question】Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1Trivia:This problem was inspired by this original twe
2015-09-05 16:48:13
271
原创 leetcode: (235) Lowest Common Ancestor of a Binary Search Tree
【Question】Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to the definition of LCA on Wikipedia: “The lowest common ancestor i
2015-09-05 16:17:30
253
原创 leetcode: (100) Same Tree
[]Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical and the nodes have the same value.方法
2015-09-05 16:00:56
288
原创 leetcode: (104) Maximum Depth of Binary Tree
【Question】Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.利用递归/** * Definit
2015-09-05 15:37:00
275
原创 leetcode: (136) Single Number
【Question】Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it w
2015-09-03 13:00:54
247
原创 华为oj:输出单向链表中倒数第k个结点
描述输入一个单向链表,输出该链表中倒数第k个结点,链表的倒数第0个结点为链表的尾指针。链表结点定义如下:struct ListNode{ int m_nKey; ListNode* m_pNext;};详细描述:接口说明原型:ListNode* FindKthToTail(ListNode* pListHead, unsignedint k);输入参数:
2015-09-01 22:38:36
567
原创 链表的基本操作
C/C++首先,用结构体创建节点struct ListNode{ int val; ListNode* next;};一、初始化操作第1种,不返回的情况void InitList1(ListNode **L){ *L =(ListNode*)malloc(sizeof(ListNode)); (*L)->next=NULL;}第2种,不返回的情况
2015-09-01 21:48:38
357
原创 华为oj: 提取不重复的整数
描述输入一个int型整数,按照从右向左的阅读顺序,返回一个不含重复数字的新的整数。知识点数组运行时间限制10M内存限制128输入输入一个int型整数输出按照从右向左的阅读顺序,返回一个不含重复数字的新的整数如果返的整数以0开头,去掉0;如
2015-09-01 18:51:05
354
原创 leetcode: (201) Count Primes
Description:Count the number of prime numbers less than a non-negative number, n.Credits:Special thanks to @mithmatt for adding this problem and creating all test cases.由于对时间复杂度的要求,一直不能通
2015-08-31 21:52:27
342
原创 leetcode: (9) Palindrome Number
Determine whether an integer is a palindrome. Do this without extra space.方法一:首先求出x一共有多少位,然后从比最低位与最高位的值开始比较低位的值可以通过 x(pow(10,i))%10的得到高位的值首先要把第i位前面的去掉x- x/pow(10,count-i)*pow(10,count-i)然后高位的值
2015-08-29 22:54:38
358
原创 leetcode: (205) Isomorphic Strings
Given two strings s and t, determine if they are isomorphic.Two strings are isomorphic if the characters in s can be replaced to get t.All occurrences of a character must be replaced with anot
2015-08-29 11:31:27
270
原创 leetcode: (219) Contains Duplicate II
【Question】Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the difference between i andj is a
2015-08-28 20:50:16
316
原创 华为oj:名字的漂亮度
描述给出一个名字,该名字有26个字符串组成,定义这个字符串的“漂亮度”是其所有字母“漂亮度”的总和。每个字母都有一个“漂亮度”,范围在1到26之间。没有任何两个字母拥有相同的“漂亮度”。字母忽略大小写。给出多个名字,计算每个名字最大可能的“漂亮度”。知识点字符串运行时间限制0M内存限制0输入
2015-08-28 19:47:53
414
原创 C/C++, 字符库函数
头文件#include 、#include 1. bool isalnum(char c)判断一个字符是否为字母或数字2. bool isalpha(char c)判断一个字符是否为字母3. bool isdigit( char c)判断字符是否为数字4. bool iscntrl(char c)判断字符是否为控制符5.bool isl
2015-08-27 18:45:15
311
原创 leetcode: (125) Valid Palindrome
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Panama" is a palindrome."race a car" is not a
2015-08-27 18:04:33
225
原创 华为oj : 挑7
描述输出7有关数字的个数,包括7的倍数,还有包含7的数字(如17,27,37...70,71,72,73...)的个数知识点循环运行时间限制0M内存限制0输入一个正整数N。(N不大于30000)输出不大于N的与7有关的数字个数,例如输入20,与7有关的
2015-08-27 15:54:21
353
原创 华为oj: 输入n个整数,输出其中最小的k个
述输入n个整数,输出其中最小的k个。详细描述:接口说明原型:bool GetMinK(unsignedint uiInputNum, int * pInputArray, unsignedint uiK, int * pOutputArray);输入参数: unsignedint uiInputNum //输入整数个数int * pInputArray //输入整数数组unsig
2015-08-27 15:41:40
463
原创 华为oj: 字符串反转
描述写出一个程序,接受一个字符串,然后输出该字符串反转后的字符串。例如:知识点数组,指针运行时间限制10M内存限制128输入输入N个字符输出输出该字符串反转后的字符串样例输入abcd样例输出dcba
2015-08-27 14:34:16
488
1
原创 华为oj: 字符串加解密
描述题目描述1、对输入的字符串进行加解密,并输出。2加密方法为:当内容是英文字母时则用该英文字母的后一个字母替换,同时字母变换大小写,如字母a时则替换为B;字母Z时则替换为a;当内容是数字时则把该数字加1,如0替换1,1替换2,9替换0;其他字符不做变化。3、解密方法为加密的逆过程。 接口描述: 实现接口,每个接口实现1个基本操作:void Encrypt (char aucPass
2015-08-27 13:42:06
429
原创 华为oj: 图片整理
描述Lily上课时使用字母数字图片教小朋友们学习英语单词,每次都需要把这些图片按照大小(ASCII码值从小到大)排列收好。请大家给Lily帮忙,通过C语言解决。 知识点字符串运行时间限制0M内存限制0输入Lily使用的图片包括"A"到"Z"、"a"到"z"、"0"到"9"。输入字母或数字
2015-08-26 19:41:45
929
1
原创 华为oj: 字符串最后一个单词的长度
描述计算字符串最后一个单词的长度,单词以空格隔开。知识点字符串,循环运行时间限制0M内存限制0输入一行字符串,长度小于128。输出整数N,最后一个单词的长度。样例输入hello world样例输出
2015-08-26 16:44:46
564
原创 leetcode: (88) Merge Sorted Array
【Question】Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note:You may assume that nums1 has enough space (size that is greater or equal to m +
2015-08-26 13:41:54
254
原创 leetcode: (119) Pascal's Triangle II
【Question】Given an index k, return the kth row of the Pascal's triangle.For example, given k = 3,Return [1,3,3,1].Note:Could you optimize your algorithm to use only O(k) extra space?
2015-08-25 22:28:19
319
原创 leetcode: (118) Pascal's Triangle
【Question】Given numRows, generate the first numRows of Pascal's triangle.For example, given numRows = 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]]杨辉三角的特点是:每i行
2015-08-25 21:26:58
294
原创 leetcode: (27) Remove Element
【Question】Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't matter what you leave beyond the
2015-08-25 19:54:54
218
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人