自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(21)
  • 资源 (2)
  • 收藏
  • 关注

原创 C++ 求排列组合

在笔试面试中经常会遇到求排列组合的题目(或者需求),现在将它们做一个总结。1.排列数公式与组合数公式2.思路参考程序员面试宝典P112,求9位数能被整除的问题(具体请自己去看书),实际上的思路就是利用一个bool型数组记录被占用的位置,DFS求解。这里想指出STL有next_permutation方法。vector<string> res;void dfs(...

2018-09-03 23:35:05 4401

原创 114. Flatten Binary Tree to Linked List

class Solution {public: void Core(TreeNode* root) { int flag = 0; if (root->left != NULL && (root->left->left != NULL || root->left->right != NULL)) Core(root->lef...

2018-09-01 20:36:07 110

原创 数组指针试题

#include<iostream>using namespace std;int main(){ int data[][3] = { 10,20,30,40,50,60 }; int(*p)[3]; p = data; cout << p[0][0] << "," << *(p[0] + 1) << "," &a

2018-08-31 20:11:34 245

原创 149. Max Points on a Line

Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.Example 1:Input: [[1,1],[2,2],[3,3]]Output: 3Explanation:^||        o|     o|  o  +-----...

2018-08-30 16:29:00 111

原创 143. Reorder List

Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…You may not modify the values in the list's nodes, only nodes itself may be changed.Example 1:Given 1->2-...

2018-08-30 11:23:19 87

原创 148. Sort List

Sort a linked list in O(n log n) time using constant space complexity.Example 1:Input: 4->2->1->3Output: 1->2->3->4Example 2:Input: -1->5->3->4->0Output: -1-...

2018-08-28 17:55:08 88

原创 c++虚函数表探究(2018.9.18更新)

2018.9.18更新关于虚继承的sizeof问题#include <iostream>#include <vector>#include <string.h>#include <stdio.h>using namespace std;class A{public: char a[4]; virtual void aa()...

2018-08-25 18:14:21 232

原创 一道很有意思的C++面试题

原题目为《程序员面试宝典》第7章面试题9:struct S{ int i; int *p;};main(){ S s; int *p =&s.i; p[0] = 4; p[1] = 3; s.p = p; s.p[1] = 1; s.p[0] = 2;}问程序会在哪一行崩溃?第一次做这道题时我崩溃...

2018-08-18 23:57:00 214

原创 438. Find All Anagrams in a String

Given a string s and a non-empty string p, find all the start indices of p's anagrams in s.Strings consists of lowercase English letters only and the length of both strings s and p will not be larger ...

2018-06-09 11:33:01 130

原创 543. Diameter of Binary Tree

Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path between any two nodes in a tree. This path may or may n...

2018-06-09 10:47:39 139

原创 394. Decode String

Given an encoded string, return it's decoded string.The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactly k times. Note that k is guara...

2018-06-09 10:27:43 131

原创 338. Counting Bits

Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and return them as an array.Example:For num = 5 you sho...

2018-06-04 10:38:51 96

原创 315. Count of Smaller Numbers After Self

You are given an integer array nums and you have to return a new counts array. The counts array has the property where counts[i] is the number of smaller elements to the right of nums[i].Example:Input...

2018-06-04 10:12:59 192

原创 538. Convert BST to Greater Tree

Given a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus sum of all keys greater than the original key in BST.Example:...

2018-06-04 09:20:39 83

原创 11. Container With Most Water

Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two ...

2018-06-01 17:58:07 112 1

原创 DP基本问题总结(2018.5.29 2018.6.9 2018.8.9更新)

参考文献:【1】https://segmentfault.com/a/1190000006325321【2】https://blog.csdn.net/q623702748/article/details/51297949一晃就过去了两个月,提前退出了网易游戏的实习,前途未卜。但不管怎么样,生活还是要继续。DP问题还是在笔试里考得多些,还要记录笔试DP的题目。网易笔试:合唱团:ht...

2018-05-30 11:15:56 843

原创 312. Burst Balloons

Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloons. If the you burst balloon i you will get nums[le...

2018-05-29 11:56:48 146

原创 124. Binary Tree Maximum Path Sum

Given a non-empty binary tree, find the maximum path sum.For this problem, a path is defined as any sequence of nodes from some starting node to any node in the tree along the parent-child connections...

2018-05-27 22:02:46 318

原创 102. Binary Tree Level Order Traversal

Given a binary tree, return the level order traversal of its nodes' values. (i.e, from left to right, level by level).For example:Given binary tree [3,9,20,null,null,15,7], 3 / \ 9 20 / ...

2018-05-26 11:25:54 77

原创 94. Binary Tree Inorder Traversal

Given a binary tree, return the inorder traversal of its nodes' values.Example:Input: [1,null,2,3] 1 \ 2 / 3Output: [1,3,2]Follow up: Recursive solution is trivial, could you do i...

2018-05-25 22:30:02 122

原创 309. Best Time to Buy and Sell Stock with Cooldown

题目如下: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 like (ie, buy o...

2018-05-24 22:35:15 80

【Andrea Goldsmith】无线通信

Andrea Goldsmith所著《无线通信》与答案,相比于David Tse的《无线通信基础》,较为基础。文档为PDF,图片公式非常清晰!

2018-01-26

数字通信(第4版) Proakis 中文

经典的数字通信教材,为John G.Proakis所著。中译版,影印,图片和公式均清晰可见。

2018-01-26

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除