原创 筆試題:求二叉樹和值爲sum的所有路徑

#include <iostream> #include <stack> using namespace std; struct TreeNode { int data; TreeNode *left;

原创 筆試題:動態規劃之求數組中的最長路徑

#include <iostream> using namespace std; void Grial(int (*a)[5],int (*b)[5],int x, int y) { if(x>=5 || y>=

原创 筆試題:cvte第一題二分法求字符串

#include <iostream> using namespace std; typedef struct String2Number { char *String; int code; }; String2N

原创 筆試題:撲克牌順子

題目描述 LL今天心情特別好,因爲他去買了一副撲克牌,發現裏面居然有2個大王,2個小王(一副牌原本是54張^_^)…他隨機從中抽出了5張牌,想測測自己的手氣,看看能不能抽到順子,如果抽到的話,他決定去買體育彩票,嘿嘿!!“紅心A,

原创 C++數組的排列組合

#include <iostream> using namespace std; void move(int a, int b) { cout << "move" << a << "to" << b << endl; } void ha

原创 java:水仙花數打印

package liuhuiyan; public class work { public static void main(String[] args) { //打印出所有的“水仙花數”,所謂“水仙花數”

原创 C++:數組排列組合的問題。

//求一個長度爲n的數組中長度爲m的所有排列組合。 #include <iostream> #include <stack> using namespace std; stack<int> st; void Grial(int a[],

原创 筆試題:知識點總結

#include <iostream> using namespace std; int main() { int *a = new int; for (int i = 0; i < 20; i++) {

原创 找出一組數據中多次出現的所有數字(空間要求最低)

#include <iostream> #include <bitset> #include <map> using namespace std; void CheckDuplicates(int *array, int len) {

原创 筆試題:再hash法

#include<iostream> #include <string.h> #define DefaultSize 13 using namespace std; struct PeopleNode { int flags;

原创 C/C++:用數組構造隊列。

#include <iostream> #include <stdlib.h> using namespace std; //用數組實現隊列,我開始的想法是用一個數組來實現,那麼每次的pop() //操作都會移動整個數組,後來我又想到另外

原创 使用Auto Layout中的VFL進行自動佈局

使用Auto Layout中的VFL進行自動佈局 UIButton *btn1 = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 40, 40)]; btn1.background

原创 java:java中static關鍵字的理解

package liuhuiyan; public class work { public static void main(String[] args) { //main方法只能存在類中且只能唯一存在,這是程序的入口。 CA

原创 來騰訊已經一年了,大家加油。

轉眼已經到騰訊一年了,我依然每天堅持寫自己的總結 希望大家都可以每天加油,每天都是一個嶄新的開始,都是一個新的起點。

原创 數據結構:單鏈表

//單鏈表// #include <iostream> #include <stdlib.h> using namespace std; template<typename Type> struct Node { Type da