07 2015 档案

摘要:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Pana... 阅读全文
posted @ 2015-07-30 22:36 小金乌会发光-Z&M 阅读(222) 评论(0) 推荐(0)
摘要:Given an array of sizen, find the majority element. The majority element is the element that appears more than⌊ n/2 ⌋times.You may assume that the arr... 阅读全文
posted @ 2015-07-29 22:25 小金乌会发光-Z&M 阅读(181) 评论(0) 推荐(0)
摘要:Design a stack that supports push, pop, top, and retrieving(检索) the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Rem... 阅读全文
posted @ 2015-07-28 22:29 小金乌会发光-Z&M 阅读(271) 评论(0) 推荐(0)
摘要:Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: a... 阅读全文
posted @ 2015-07-26 14:55 小金乌会发光-Z&M 阅读(438) 评论(0) 推荐(0)
摘要:Given an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.分析:题意即为 阶乘尾部的零(求n!中尾部为0的个数)思路... 阅读全文
posted @ 2015-07-26 13:31 小金乌会发光-Z&M 阅读(211) 评论(0) 推荐(0)
摘要:Rotate an array ofnelements to the right byksteps.For example, withn= 7 andk= 3, the array[1,2,3,4,5,6,7]is rotated to[5,6,7,1,2,3,4].Note:Try to come... 阅读全文
posted @ 2015-07-19 13:13 小金乌会发光-Z&M 阅读(228) 评论(0) 推荐(0)
摘要:Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as00000010100101000001111010011100), return ... 阅读全文
posted @ 2015-07-19 11:05 小金乌会发光-Z&M 阅读(221) 评论(0) 推荐(0)
摘要:Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as theHamming weight).For example, the 32-bit in... 阅读全文
posted @ 2015-07-19 10:29 小金乌会发光-Z&M 阅读(158) 评论(0) 推荐(0)
摘要:Remove all elements from a linked list of integers that have valueval.ExampleGiven:1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6,val= 6Return:1 --> 2 --> 3 --... 阅读全文
posted @ 2015-07-18 22:04 小金乌会发光-Z&M 阅读(201) 评论(0) 推荐(0)
摘要:一、Rank ScoresWrite a SQL query to rank scores. If there is a tie between two scores, both should have the same ranking. Note that after a tie, the nex... 阅读全文
posted @ 2015-07-17 19:58 小金乌会发光-Z&M 阅读(201) 评论(0) 推荐(0)
摘要:Given a singly linked list, determine if it is a palindrome.Follow up:Could you do it in O(n) time and O(1) space?分析:题意为判断单链表是否为回文的。思路:首先想到的是 遍历一次单链表,... 阅读全文
posted @ 2015-07-17 17:13 小金乌会发光-Z&M 阅读(196) 评论(0) 推荐(0)
摘要:Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to thedefinition of LCA on Wikipedia: ... 阅读全文
posted @ 2015-07-17 10:55 小金乌会发光-Z&M 阅读(205) 评论(0) 推荐(0)
摘要:Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the linked list is1 -> 2 -> 3 -> ... 阅读全文
posted @ 2015-07-16 22:28 小金乌会发光-Z&M 阅读(214) 评论(0) 推荐(0)
摘要:You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping yo... 阅读全文
posted @ 2015-07-16 13:36 小金乌会发光-Z&M 阅读(303) 评论(0) 推荐(0)
摘要:在C&C++中一、inline关键字用来定义一个类的内联函数,引入它的主要原因是用它替代C中表达式形式的宏定义。表达式形式的宏定义一例:#define ExpressionName(Var1,Var2) ((Var1)+(Var2))*((Var1)-(Var2))取代这种形式的原因如下:1. C中... 阅读全文
posted @ 2015-07-15 20:45 小金乌会发光-Z&M 阅读(704) 评论(1) 推荐(1)
摘要:参见MySQL(以5.1为例)中官方手册:MySQL官方手册-JOIN假设有以下几个表t1idbook1java2c++3phpt2idauthor2zhang3wang4lit3authoryearzhang2003ma2006liu2011Inner Join 内连接将两个表中存在连接关系的字段... 阅读全文
posted @ 2015-07-15 15:10 小金乌会发光-Z&M 阅读(278) 评论(0) 推荐(0)
摘要:Isomorphic StringsGiven two stringssandt, determine if they are isomorphic.Two strings are isomorphic if the characters inscan be replaced to gett.All... 阅读全文
posted @ 2015-07-11 23:45 小金乌会发光-Z&M 阅读(193) 评论(0) 推荐(0)
摘要:VS中常用的快捷键:ctrl+s 保存ctrl+Shift+S 保存所有VS中打开的所有文件ctrl+O 打开新文件ctrl+Shift+O 打开项目ctrl+Shift+A 当前项目中添加新建项ctrl+F4 关闭当前打开页ctrl+F6 跳到下一个窗口ctrl+... 阅读全文
posted @ 2015-07-10 22:05 小金乌会发光-Z&M 阅读(251) 评论(0) 推荐(0)
摘要:为了使自己的程序有很好的移植性,c++程序员应该尽量使用size_t和size_type而不是int, unsigned1. size_t是全局定义的类型;size_type是STL类中定义的类型属性,用以保存任意string和vector类对象的长度2. string::size_type制类型一... 阅读全文
posted @ 2015-07-08 18:41 小金乌会发光-Z&M 阅读(278) 评论(0) 推荐(0)
摘要:一、Duplicate EmailsWrite a SQL query to find all duplicate emails in a table namedPerson.+----+---------+| Id | Email |+----+---------+| 1 | a@b.com... 阅读全文
posted @ 2015-07-08 15:26 小金乌会发光-Z&M 阅读(359) 评论(0) 推荐(0)
摘要:一、Implement Stack using QueuesImplement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the ele... 阅读全文
posted @ 2015-07-08 13:31 小金乌会发光-Z&M 阅读(317) 评论(0) 推荐(0)
摘要:1982年,J.Hopfield提出了可用作联想存储器的互连网络,这个网络称为Hopfield网络模型,也称Hopfield模型。Hopfield神经网络模型是一种循环神经网络,从输出到输入有反馈连接。Hopfield网络有离散型和连续型两种。反馈神经网络由于其输出端有反馈到其输入端;所以,Hopf... 阅读全文
posted @ 2015-07-06 21:24 小金乌会发光-Z&M 阅读(6789) 评论(0) 推荐(0)
摘要:RBF网络能够逼近任意的非线性函数,可以处理系统内的难以解析的规律性,具有良好的泛化能力,并有很快的学习收敛速度,已成功应用于非线性函数逼近、时间序列分析、数据分类、模式识别、信息处理、图像处理、系统建模、控制和故障诊断等。简单说明一下为什么RBF网络学习收敛得比较快。当网络的一个或多个可调参数(权... 阅读全文
posted @ 2015-07-06 21:00 小金乌会发光-Z&M 阅读(1308) 评论(0) 推荐(0)
摘要:BP(Back Propagation)神经网络是1986年由Rumelhart和McCelland为首的科学家小组提出,是一种按误差逆传播算法训练的多层前馈网络,是目前应用最广泛的神经网络模型之一。BP网络能学习和存贮大量的输入-输出模式映射关系,而无需事前揭示描述这种映射关系的数学方程。它的学习 阅读全文
posted @ 2015-07-06 20:38 小金乌会发光-Z&M 阅读(2713) 评论(0) 推荐(0)
摘要:Given an integer, write a function to determine if it is a power of two.分析:这道题让我们判断一个数是否为2的次方数(而且要求时间和空间复杂度都为常数),那么对于这种玩数字的题,我们应该首先考虑位操作 Bit Manipulat... 阅读全文
posted @ 2015-07-06 12:58 小金乌会发光-Z&M 阅读(250) 评论(0) 推荐(0)
摘要:在《编程之美》一书中有一节提到如何求一个字节的无符号整型变量二进制表示中1的个数,主要提到了四种方法。下面简单介绍一下:1.求余法在将十进制数转换为二进制数时,采用除2取余法。将每次除2得到的余数保存起来逆序输出便是该十进制整数的二进制表示。因此可以采用这种方法去统计1的个数。intcount(un... 阅读全文
posted @ 2015-07-06 12:41 小金乌会发光-Z&M 阅读(264) 评论(0) 推荐(0)
摘要:一、Contains DuplicateGiven an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at le... 阅读全文
posted @ 2015-07-05 21:10 小金乌会发光-Z&M 阅读(341) 评论(0) 推荐(0)
摘要:Given a sorted integer array without duplicates, return the summary of its ranges.For example, given[0,1,2,4,5,7], return["0->2","4->5","7"].分析:题意为给定一... 阅读全文
posted @ 2015-07-05 17:01 小金乌会发光-Z&M 阅读(236) 评论(0) 推荐(0)
摘要:一、Rising Temperature Given a Weather table, write a SQL query to find all dates' Ids with higher temperature compared to its previous (yesterday's) da 阅读全文
posted @ 2015-07-04 17:12 小金乌会发光-Z&M 阅读(250) 评论(0) 推荐(0)