- 博客(1032)
- 资源 (7)
- 问答 (1)
- 收藏
- 关注
原创 Reverse Linked List 链表逆转 简单题
Reverse Linked ListReverse a singly linked list.click to show more hints./** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * Li
2015-09-18 11:07:04 460
原创 Search a 2D Matrix II 特殊数组的查找
Search a 2D Matrix II Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted in ascending f
2015-09-10 14:50:29 329
原创 Product of Array Except Self 数组除自身的所有乘积
Product of Array Except Self Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i]
2015-09-10 14:49:33 524
转载 iOSInterviewQuestions/iOS面试问题
1. 风格纠错题typedef enum { UserSex_Man, UserSex_Woman}UserSex;@interface UserModel : NSObject@property (nonatomic, strong) NSString *name;@property (assign,nonatomic) int age;@property
2015-09-09 19:49:40 897
原创 H-Index II 二分查找
H-Index II Follow up for H-Index: What if the citations array is sorted in ascending order? Could you optimize your algorithm?Hint:Expected runtime complexity is in O(log n) and the
2015-09-09 14:10:33 671
原创 Integer to English Words 整数转换为英语表示
Integer to English Words Convert a non-negative integer to its english words representation. Given input is guaranteed to be less than 231 - 1.For example,123 -> "One Hundred Twenty
2015-09-09 14:07:55 590 3
原创 斯坦福大学公开课 iOS应用开发教程学习笔记(第四课) Views 视图
第一部分Demo简单计算器的实现 通过递归栈改变项目:http://blog.csdn.net/u012605629/article/details/48291629第二部分,Viewsview的内容1、View是屏幕上一个矩形的空间2、View处理两件事:画出矩形控件,并处理其中的事件3、view组织架构:Vie
2015-09-08 16:43:46 604
原创 斯坦福大学iOS应用开发教程学习笔记(第二课) 计算器实现2 改进版
主要内容同:http://blog.csdn.net/u012605629/article/details/48056593,有部分改进,更改了Calculator部分实现 使用一个递归栈实现。整个项目下载:https://github.com/junxianhu/Calculator-v2,觉得有帮助的可以点击Star啊,谢谢啦。贴几个变化的代码:Ca
2015-09-08 15:30:42 812
原创 First Bad Version 第一个坏数 二分查找
First Bad Version You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each versi
2015-09-08 14:10:02 912
原创 H-Index 引用次数 排序
H-Index Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index.According to the definition of h-index o
2015-09-08 14:08:24 920
原创 Invert Binary Tree 二叉树的镜像
Invert Binary TreeInvert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1Trivia:This problem was inspired by this or
2015-09-06 11:31:17 366
原创 Implement Stack using Queues 两个队列实现一个栈
Implement Stack using Queues Implement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top() -- Get
2015-09-06 11:28:16 431
原创 Summary Ranges 连续的数组格式化输出
Summary Ranges 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"].Credits:Special thanks to
2015-09-01 14:19:33 470
原创 Power of Two 判断是否为2的次方
Power of Two Given an integer, write a function to determine if it is a power of two.Credits:Special thanks to @jianchao.li.fighter for adding this problem and creating all test cases.
2015-09-01 11:05:25 421
原创 斯坦福大学iOS应用开发教程学习笔记(第三课) Objective-C
1、为什么用property,理由有两个: 实体变量的安全性和继承能力 提供延迟实例化,比如:UI更新,一次性检测。1.1 property可以没有实体变量,怎么做到的呢? 不要用@synthesize,自己创建getter 和setter.1.2 反过来,也可以有实体变量,没有property。不过建议使用property。2、为什么用.号
2015-08-31 21:38:51 629
原创 Implement Queue using Stacks 两个栈实现队列
Implement Queue using Stacks Implement the following operations of a queue using stacks.push(x) -- Push element x to the back of queue.pop() -- Removes the element from in front of queue
2015-08-31 11:37:49 412
原创 Palindrome Linked List 判断链表是否回文 栈实现
Palindrome Linked List 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?/** * Definition for singly-linked list. * st
2015-08-31 11:28:29 460
原创 Lowest Common Ancestor of a Binary Search Tree 递归寻找二叉查找树公共祖先
Lowest Common Ancestor of a Binary Search Tree 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 W
2015-08-29 13:03:11 356
原创 Delete Node in a Linked List 单链表删除节点
Delete Node in a Linked List 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 is 1 -> 2 -> 3 -> 4 and
2015-08-29 12:49:05 343
原创 斯坦福大学iOS应用开发教程学习笔记(第二课) 计算器实现(mvc实战)
整个项目下载:https://github.com/junxianhu/Calculator,觉得有帮助的可以点击Star啊,谢谢啦。界面不太好看!==!主要的文件目录如下:贴几个关键的文件,其实注视都很详细,可以下载下来仔细看:ViewController.h#import @interface ViewController
2015-08-28 20:07:44 1143
原创 Valid Anagram 比较两个字符串是否相同
Valid Anagram Given two strings s and t, write a function to determine if t is an anagram of s.For example,s = "anagram", t = "nagaram", return true.s = "rat", t = "car", return false.
2015-08-28 15:39:19 454
原创 最长递增子序列 O nlgn时间复杂度
[编程题]最长递增子序列对于一个数字序列,请设计一个复杂度为O(nlogn)的算法,返回该序列的最长上升子序列的长度,这里的子序列定义为这样一个序列U1,U2...,其中Ui 给定一个数字序列A及序列的长度n,请返回最长上升子序列的长度。测试样例:[2,1,4,3,1,5,6],7返回:4class AscentSequence {public:
2015-08-28 15:17:24 2136
原创 Add Digits
Add Digits Given a non-negative integer num, repeatedly add all its digits until the result has only one digit.For example:Given num = 38, the process is like: 3 + 8 = 11, 1 + 1 =
2015-08-27 14:26:17 310
原创 Binary Tree Paths 二叉树遍历
Binary Tree Paths Given a binary tree, return all root-to-leaf paths.For example, given the following binary tree: 1 / \2 3 \ 5All root-to-leaf paths are:["1->2->5"
2015-08-27 14:24:39 411
原创 斯坦福大学iOS应用开发教程学习笔记(第一课) MVC/Objective-C
最近准备学习学习iOS,心情好看看书,不好看看视频吧。这是第一课,本文也参考了http://blog.csdn.net/totogo2010/article/details/8205810 系列博客。1、iOS的概述-什么是iOS2、MVC - 面向对象的概念3、Objective-C-介绍下语言的概念1、iOS的概述1、内核内核是mach 4.x
2015-08-26 17:53:59 840
原创 Missing Number 第一个缺失的数
Missing Number Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array.For example,Given nums = [0, 1, 3] return 2.Note:
2015-08-26 15:44:51 505
原创 Single Number III 两个不同的数出现一次,其余两次,异或
Single Number III 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 onc
2015-08-26 15:44:04 462
原创 Ugly Number II 寻找第N个丑数
Ugly Number II Write a program to find the n-th ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1, 2, 3, 4, 5, 6, 8, 9, 10, 12 is t
2015-08-25 14:25:05 494
原创 Ugly Number 寻找丑数 简单题
Ugly Number Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 6, 8 are ugly while
2015-08-25 14:23:36 505
原创 初识 GitHub
主要参考官方的bootcamp https://help.github.com/articles/set-up-git/Set Up Git在GitHub的心脏是一个开源的版本控制系统(VCS)称为Git的。 Git是负责一切GitHub上有关这发生在本地计算机上。如果你不喜欢使用命令行,现在,GitHub上,您可以完成许多Git的相关操作,而无需使用命令行,其中包
2015-08-18 21:43:58 1870 3
原创 Edit Distance 计算两个字符串的变化距离 动态规划
Edit Distance Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)You have the following 3 operati
2015-08-17 15:05:09 832
原创 华为机试题目 若干
闲着无聊,刷了几题华为机试题,适应下。最小长方形描述: 给定一系列2维平面点的坐标(x, y),其中x和y均为整数,要求用一个最小的长方形框将所有点框在内。长方形框的边分别平行于x和y坐标轴,点落在边上也算是被框在内。运行时间限制: 10 Sec内存限制: 128 MByte输入: 测试输入包含若干测试用例,每个测试用例由一系列坐标组成,每对坐标(x y) 占一行,其中
2015-08-13 21:29:00 1248 2
转载 《深度探索C++对象模型》读书笔记
Inside The C++ Object ModelStanley B. Lippman 转:http://blog.csdn.net/dwater《深度探索C++对象模型》读书笔记 前 言 Stanley B.Lippman
2015-07-31 21:00:14 964
原创 Plus One 数组加1,vector处理
Plus One Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at the head of the list.H
2015-07-17 18:52:30 626
原创 Insert Interval 插入区间到多个区间
Insert Interval Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially sorted according to
2015-07-16 16:17:38 669
原创 动手写第一个windows程序 新建一个窗口
主要熟悉windows窗口的一些窗口类,显示等,比较简单,注释比较详细了;#include#include// 函数声明LRESULT CALLBACK WinCipher( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);//主函数int WINAPI WinMain( HINSTANCE hInstance,
2015-07-14 21:25:37 986
原创 Merge Intervals 多区间合并
Merge Intervals Given a collection of intervals, merge all overlapping intervals.For example,Given [1,3],[2,6],[8,10],[15,18],return [1,6],[8,10],[15,18].Hide Tags Array Sort
2015-07-14 14:36:49 501
原创 N-Queens II 回溯法求八皇后
N-Queens II Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.Hide Tags BacktrackingHide Similar Prob
2015-07-13 19:09:20 482
原创 N-Queens N皇后放置问题 回溯法
N-Queens The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other.Given an integer n, return all distinct solutions to the n-
2015-07-09 19:30:17 842
spring mybatis sql语句使用注解描述
2016-10-08
TA创建的收藏夹 TA关注的收藏夹
TA关注的人