05 2015 档案
摘要:一、问题描述 Description: You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of ...
阅读全文
摘要:一、问题描述 Description: Divide two integers without using multiplication, division and mod operator. If it is overflow, return MAX_INT.不使用...
阅读全文
摘要:一、问题描述 Description: Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part o...
阅读全文
摘要:一、问题描述 Description: Given an array and a value, remove all instances of that value in place and return the new length. The order of el...
阅读全文
摘要:一、问题描述 Description: Given a sorted array, remove the duplicates in place such that each element appear only once and return the new lengt...
阅读全文
摘要:一、问题描述 Description: Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If the number of...
阅读全文
摘要:一、问题描述 Description: Given a linked list, swap every two adjacent nodes and return its head. For example: Given 1->2->3->4, you shou...
阅读全文
摘要:一、问题描述 Description: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.合并 k 个有序链表。二、解题报告解法...
阅读全文
摘要:一、实习季Timeline从2015年4月开始找实习,前后历时两个月,参加了很多的笔试/面试。这是一个焦虑又美好的学期,我在这段时间里学到了很多东西。这一个学期就这么磕磕绊绊的过了一半了,决定去360实习以后,也终于能安下心来。因为等待(笔试/面试通知)真的是很痛苦的一件事。参加的...
阅读全文
摘要:一、问题描述 Description: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For exampl...
阅读全文
摘要:一、问题描述 Description: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes...
阅读全文
摘要:一、问题描述 Description: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid...
阅读全文
摘要:一、问题描述 Description: Given a linked list, remove the nth node from the end of list and return its head. For example: Given linked li...
阅读全文
摘要:一、问题描述 Description: Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all uni...
阅读全文
摘要:一、问题描述 Description: Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit ...
阅读全文
摘要:一、问题描述 Description: Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Retu...
阅读全文
摘要:一、问题描述 Description: Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in ...
阅读全文
摘要:一、问题描述 Description: Write a function to find the longest common prefix string amongst an array of strings.给定一组字符串,写一个函数找出它们的最长公共前缀。二、解题报告...
阅读全文
摘要:一、问题描述 Description: Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999.给定一个字符串表...
阅读全文
摘要:一、问题描述 Description: Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999.将一个整数用罗马...
阅读全文
摘要:一、问题描述 Description: Given n non-negative integers a1,a2,...,an, where each represents a point at coordinate (i,ai). n vertical lines are ...
阅读全文
摘要:一、问题描述 Description: Implement regular expression matching with support for '.' and '*'. '.' Matches any single character. '*' Matche...
阅读全文
摘要:一、问题描述 Description: Design a data structure that supports the following two operations: void addWord(word)bool search(word) search(...
阅读全文
摘要:一、问题描述 Description: There are a total of n courses you have to take, labeled from 0 to n−1. Some courses may have prerequisites, for e...
阅读全文
摘要:一、问题描述 Description: Determine whether an integer is a palindrome. Do this without extra space.判断一个整数是否是回文数,不要使用额外的空间。二、解题报告解题时我们需要注意一下几点:...
阅读全文
摘要:一、问题描述 Description: Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you wa...
阅读全文
摘要:一、问题描述 Description: Reverse digits of an integer. For example: Input x = 123, return 321 Input x = -123, return -321二、解题报告本题是对一个整...
阅读全文
摘要:一、问题描述 Description: The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to disp...
阅读全文
摘要:一、问题描述 Description: Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, a...
阅读全文
摘要:回文串,就是指正读和反读都一样的字符串,比如"level"或者"noon"等等。那么,如何求一个字符串的最长回文子串(Longest Palindromic Substring)?这里我们有多种解法。解法一:暴力法暴力解法就是直接枚举所有子串,对每个子串判断是否为回文,时间复杂度为...
阅读全文
摘要:一、问题描述 Description: Given an array of n positive integers and a positive integer s, find the minimal length of a subarray of which the su...
阅读全文
摘要:一、问题描述 Description: There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. T...
阅读全文
摘要:一、问题描述 Description: Given a string, find the length of the longest substring without repeating characters. For example: For "abcab...
阅读全文
摘要:一、问题描述 Description: You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each...
阅读全文
摘要:一、问题描述 Description: Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSu...
阅读全文
摘要:一、什么是Cache1 概念Cache,即高速缓存,是介于CPU和内存之间的高速小容量存储器。在金字塔式存储体系中它位于自顶向下的第二层,仅次于CPU寄存器。其容量远小于内存,但速度却可以接近CPU的频率。当CPU发出内存访问请求时,会先查看 Cache 内是否有请求数据。如果存在...
阅读全文
摘要:一、问题描述Description:Implement a trie with insert, search, and startsWith methods.Note: You may assume that all inputs are consist of lowercase ...
阅读全文
摘要:本文用尽量简洁的语言介绍一种树形数据结构 —— Trie树。一、什么是Trie树Trie树,又叫字典树、前缀树(Prefix Tree)、单词查找树 或 键树,是一种多叉树结构。如下图: 上图是一棵Trie树,表示了关键字集合{“a”, “to”, “tea”, “ted”, “...
阅读全文
摘要:一、问题描述Description:There are a total of n courses you have to take, labeled from 0 to n−1.Some courses may have prerequisites(前提), for example...
阅读全文
摘要:一、什么是拓扑排序在图论中,拓扑排序(Topological Sorting)是一个有向无环图(DAG, Directed Acyclic Graph)的所有顶点的线性序列。且该序列必须满足下面两个条件:每个顶点出现且只出现一次。若存在一条从顶点 A 到顶点 B 的路径,那么在序列...
阅读全文
摘要:一、问题描述Description:Reverse a singly linked list.Hint: A linked list can be reversed either iteratively or recursively. Could you implement bot...
阅读全文
摘要:一直都对公钥和私钥的概念不清不楚,以至于在 腾讯面试 被问到“如何在一个不安全的环境中实现安全的数据通信?”时,并没有答上来。今天查阅了一些资料,决定写一篇总结文章来加深自己的理解。一、公钥算法与私钥算法1、私钥算法私钥加密算法,又称 对称加密算法,因为这种算法解密密钥和加密密钥是...
阅读全文
摘要:一、字节序字节序,也就是字节的顺序,指的是多字节的数据在内存中的存放顺序。在几乎所有的机器上,多字节对象都被存储为连续的字节序列。例如:如果C/C++中的一个int型变量 a 的起始地址是&a = 0x100,那么 a 的四个字节将被存储在存储器的0x100, 0x101, 0x...
阅读全文