10 2015 档案
摘要:1. 顶层const表示指针本身是个常量,而底层const表示指针所指向的对象是一个常量,顶层const可以适用于任何数据类型,而底层const只能用于指针和引用等符合类型;2. 声明constexpr类型时由编译器来验证变量是否是一个常量表达式,constexpr定义了一个常量,只能由字面值类型来...
阅读全文
摘要:题目描述:(链接)Given a linked list, remove thenthnode from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. ...
阅读全文
摘要:题目描述:(链接)Given a list, rotate the list to the right bykplaces, wherekis non-negative.For example:Given1->2->3->4->5->NULLandk=2,return4->5->1->2->3->N...
阅读全文
摘要:题目描述:(链接)Given a sorted linked list, delete all nodes that have duplicate numbers, leaving onlydistinctnumbers from the original list.For example,Give...
阅读全文
摘要:具体描述见《统计学习方法》第三章。 1 // 2 // main.cpp 3 // kNN 4 // 5 // Created by feng on 15/10/24. 6 // Copyright © 2015年 ttcn. All rights reserved. 7 //...
阅读全文
摘要:题目描述:(链接)Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -...
阅读全文
摘要:题目描述:(链接)Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, return1->2.Given1->1->2->3...
阅读全文
摘要:题目描述:(链接)Given a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox.You should preserve ...
阅读全文
摘要:题目描述:(链接)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 tha...
阅读全文
摘要:题目描述:(链接)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 fa...
阅读全文
摘要:题目描述:(链接)Reverse a singly linked list.解题思路:链表真讨厌,总是出错。头插法。 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 *...
阅读全文
摘要:题目描述:(链接)Reverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn= 4,return1->4->3->2->5...
阅读全文
摘要:题目描述:(链接):Given an arraynums, write a function to move all0's to the end of it while maintaining the relative order of the non-zero elements.For examp...
阅读全文
摘要:题目描述:(链接)There areNchildren standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the follow...
阅读全文
摘要:题目描述:(链接)There areNgas stations along a circular route, where the amount of gas at stationiisgas[i].You have a car with an unlimited gas tank and it c...
阅读全文
摘要:题目描述:(链接)Given amxnmatrix, if an element is 0, set its entire row and column to 0. Do it in place.click to show follow up.Follow up:Did you use extra ...
阅读全文
摘要:题目描述:(链接)You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 ...
阅读全文
摘要:题目描述:(链接)The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integernrepresenting the tot...
阅读全文
摘要:题目链接:(链接)You are climbing a stair case. It takesnsteps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can ...
阅读全文
摘要:题目描述:(链接)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 di...
阅读全文
摘要:题目描述:(链接)You are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?解题思路:先将矩阵选...
阅读全文
摘要:题目描述:(链接)Given apatternand a stringstr, find ifstrfollows the same pattern.Herefollowmeans a full match, such that there is a bijection between a lett...
阅读全文
摘要:题目描述:(链接)Givennnon-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after r...
阅读全文
摘要:题目描述:(链接)Determine if a Sudoku is valid, according to:Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are fil...
阅读全文
摘要:原文地址:http://download.csdn.net/download/fjp1230123/9138833 跟随iOS开发技术发展的潮流,我将持续维护本文档的中文版,如果你喜欢这个译本,也请给个 Star 鼓励下~~本文档的 "英文原版在这里" ,感谢 "Futurice" 团队卓越的工作...
阅读全文
摘要:题目描述:(链接)The set[1,2,3,…,n]contains a total ofn! unique permutations.By listing and labeling all of the permutations in order,We get the following seq...
阅读全文
摘要:以前看《C++ Primer》就看到过函数的可变参数列表,但是书中只是一带而过,具体用法没有介绍。现在把“圣经”看了一遍,以前的很多疑问都烟消云散。可变参数的使用主要用到标准头文件中定义一组宏定义,它们对如何遍历参数表进行了定义。其中:va_list类型声明一个变量(如ap),该变量将依次引用各参数...
阅读全文
摘要:题目描述:(链接)Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is no...
阅读全文
摘要:题目描述:(链接)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 do...
阅读全文
摘要:题目描述:(链接)Given an arraySofnintegers, are there elementsa,b,c, anddinSsuch thata+b+c+d= target? Find all unique quadruplets in the array which gives th...
阅读全文
摘要:题目描述:(链接)Given an arraySofnintegers, find three integers inSsuch that the sum is closest to a given number, target. Return the sum of the three intege...
阅读全文
摘要:题目描述:(链接)Given an arraySofnintegers, are there elementsa,b,cinSsuch thata+b+c= 0? Find all unique triplets in the array which gives the sum of zero.No...
阅读全文
摘要:题目描述:(链接)Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4, 200, 1, 3, 2],The...
阅读全文
摘要:题目描述:(题目链接)There are two sorted arraysnums1andnums2of size m and n respectively. Find the median of the two sorted arrays. The overall run time comple...
阅读全文
摘要:第一次读这本书的时候是大三初,现在打算重读一遍!。第一章 导言1. 学习一门新程序设计语言的唯一途径就是用它来写程序。2. 每个程序都从main函数的起点开始执行。3. 在C语言中,所有变量必须先声明后使用。4. C语言中的基本数据类型的大小取决于具体机器。5. 在允许使用某种类型变量值的任何场合,...
阅读全文
摘要:忘记了出处,侵删!!!#阿里一面1.Android的activity2.Category支持添加属性与成员变量吗3.是否了解设计模式, 用过哪些4.iOS7之后, 蓝牙的围栏功能5.MVC是否了解?介绍下使用情况。6.MVC里面, View怎么通知到Model7.了解delegate吗?并介绍8.说...
阅读全文