- 博客(293)
- 收藏
- 关注
原创 防护IOS APP安全的几种方式
1.URL编码加密 对iOS app中出现的URL进行编码加密,防止URL被静态分析 2.本地数据加密 对NSUserDefaults,sqlite存储文件数据加密,保护iOS app的帐号和关键信息。 3.网络传输数据加密 对iOS app客户端传输数据提供加密方案,有效防止通过网络接口的拦截获取 4.方法体,方法名高级混淆 对iOS app的方法名和方法体进行混淆,保证源码被逆向后无法解析代码 5.程序结构混排加密 对iOS app逻辑结构进行打乱混排,保证源码可读性降到最低一 .URL编码加密
2022-02-08 17:27:59
713
原创 使用Auto Layout中的VFL进行自动布局
使用Auto Layout中的VFL进行自动布局 UIButton *btn1 = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 40, 40)]; btn1.backgroundColor = [UIColor greenColor]; [self.view addSubview:btn1]; btn1.translatesAutoresi
2016-09-05 18:29:11
752
原创 (IOS)从UIApplication到runLoop
1.main函数中执行了一个UIApplicationMain, return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); arc表示传入的参数的个数,一般是1,有些情况当用户需要输入一些参数的时候,比如脚本语言./sh main.sh numberOne numberTwe ,此时arc就
2016-09-05 16:13:50
779
原创 c++笔试题:简易学生信息系统
//姓名 学号 成绩#include #include using namespace std;struct student{ char name[10]; int num; float score;};class studentlist{public: studentlist() { len = 0; } void Insert
2015-10-06 22:43:48
1405
1
原创 C/C++:用数组构造队列。
#include #include using namespace std;//用数组实现队列,我开始的想法是用一个数组来实现,那么每次的pop()//操作都会移动整个数组,后来我又想到另外一种方法就是用两个数组逆向//存储操作,这个有点麻烦了,并且不好扩展,于是我想到了使用环形数组来实现,//维护start,end两个下标,相当与信号量,感觉这是一个比较不错的方案,//如果超出数组
2015-10-05 11:40:01
955
原创 java:求最小公约数与最大公倍数
package liuhuiyan;public class work { public static void main(String[] args) { System.out.println("最小公约数是 : " + GetMinNum(16,16)); System.out.println("最大公倍数是: " + GetMaxNum(20,8));
2015-10-03 16:55:24
802
原创 java:水仙花数打印
package liuhuiyan;public class work { public static void main(String[] args) { //打印出所有的“水仙花数”,所谓“水仙花数”是指一个三位数,其各位数字的立方和等于该数字本身。 int i = 100; for(;i<1000;++i) {
2015-10-02 18:19:25
584
原创 算法:只用最少栈结构构造顺序栈
#include <iostream>#include <stack>using namespace std;class STACK{public: void Push(int val) { stack<int> temp; temp.push(val); while (st.empty() == false) {
2015-10-02 11:49:40
578
原创 java:java中static关键字的理解
package liuhuiyan;public class work { public static void main(String[] args) { //main方法只能存在类中且只能唯一存在,这是程序的入口。 CAL cal = new CAL(10); cal.fun();//用对象调用非静态方法。 System.out.println(CAL.Print());
2015-10-02 11:17:11
538
原创 数据结构:单链表
//单链表//#include <iostream>#include <stdlib.h>using namespace std;template<typename Type>struct Node{ Type data; Node *next; Node(Type d = Type()) :data(d), next(NULL){}};template<typ
2015-09-30 22:43:45
560
原创 排列组合问题
yy笔试题:x + y + z = 10(x,y,z均是大于0的整数),求所有可能的个数?1 1 1 1 1 1 1 1 1 1 = 10;相当于把10拆成10个1,然后用两个挡板选出三组数据就是结果,所以最后的结果是9*8/2=36(种)可能。扩展:有10个球放在4个盒子里面有多少种放法?至少保证每个盒子都有一个球。解题思路与上面一模一样,都是用挡板来进行隔离选择。
2015-09-30 22:39:36
496
原创 设计模式:解释者模式
#include #include //interpreter解释器模式。//一个解释类对封装的行为进行公共需求解释的一种方式。using namespace std;class Contex{public: Contex(string inputstr) { InterpreterStr = inputstr; }private: string Interpreter
2015-09-30 22:14:04
844
原创 C++:数组排列组合的问题。
//求一个长度为n的数组中长度为m的所有排列组合。#include <iostream>#include <stack>using namespace std;stack<int> st;void Grial(int a[], int m,int n, int length){ if (st.size() == 3) { stack<int> temp =
2015-09-17 23:36:09
4155
原创 找出一组数据中多次出现的所有数字(空间要求最低)
#include <iostream>#include <bitset>#include <map>using namespace std;void CheckDuplicates(int *array, int len){ bitset<40000> bt1; bitset<40000> bt2; for (int i = 0; i < len; i++)
2015-09-17 20:35:39
595
原创 字符串与数字的合并
#include #include using namespace std;char* CombineString(char *vendor, unsigned short checksum){ string resultstr; resultstr += vendor; resultstr += '_'; string temp; int num = checksum; wh
2015-09-17 20:13:06
833
原创 笔试题之:快排求第n大的数字
#include using namespace std;int Grial(int a[], int m,int n){ int i = m; int j = n; int temp = a[m]; while (i < j) { while (i=temp)j--; a[i] = a[j]; while (i<j && a[i]<=temp)i++; a[j]
2015-09-15 03:26:47
693
原创 腾讯2016年9月14号面试笔试题
#include #include #include #include #define DefaultSize 13//文本中的大量字符串,求出现频率最大的前n项字符串。//hash映射保存,有string保存字符串,freq保存出现的次数。//小堆heap以freq为关键值比较,求的前n项大的字符串并且输出。using namespace std; struct SNo
2015-09-14 00:19:27
652
原创 笔试题:再hash法
#include<iostream>#include <string.h>#define DefaultSize 13using namespace std;struct PeopleNode{ int flags; char *name; PeopleNode():flags(0),name(new char[20]){}};class Hash{public
2015-09-12 00:20:43
783
原创 笔试题:知识点总结
#include <iostream>using namespace std;int main(){ int *a = new int; for (int i = 0; i < 20; i++) { *(a + i) = 9; cout << *(a + i) << endl; } int b[1]; int *p =
2015-09-11 21:53:33
469
原创 笔试题:求两个乱序数组的共公数组
#include #include #include using namespace std;vector find(int a[],int n,int b[],int m){ int i = 0; vector result; bitset bt1; bitset bt2; //适合分布集中的大型数据较小的数组。 for (; i < n; i++) { bt1.se
2015-09-11 17:01:35
616
原创 笔试题:cvte第一题二分法求字符串
#include <iostream>using namespace std;typedef struct String2Number{ char *String; int code;};String2Number auString2Number[] = { {"au",0x10}, {"bc",0x2}, {"chn",0x11}, {"
2015-09-08 20:14:42
517
原创 C++数组的排列组合
#include using namespace std;void move(int a, int b){ cout << "move" << a << "to" << b << endl;}void hanoi(int n,int a,int b,int c){ if (n > 0) { hanoi(n - 1, a, c, b); move(a, b); hano
2015-09-08 12:22:17
1747
原创 笔试题:o(n)解法求最大回文串(Manacher)
#include <iostream>using namespace std;void Grial(char *s){ int maxindex = 0;//init max length int maxstart = 0; int b[100]={0}; string str; string resultStr; str+='@';
2015-09-06 21:03:37
591
原创 笔试题:求二叉树和值为sum的所有路径
#include <iostream>#include <stack>using namespace std;struct TreeNode{ int data; TreeNode *left; TreeNode *right; TreeNode(int d = int()):data(d), left(NULL), right(NULL){}};clas
2015-09-06 17:00:53
738
原创 笔试题:动态规划之求数组中的最长路径
#include <iostream>using namespace std;void Grial(int (*a)[5],int (*b)[5],int x, int y){ if(x>=5 || y>=5)return ; int i = x; int j = y; if(i-1>=0 && j-1>=0) b[
2015-09-06 08:06:06
1447
原创 算法题:数组中只出现一次的两个数字
class Solution {public: void FindNumsAppearOnce(vector<int> data,int* num1,int *num2) { int count = 0; int n = data.size(); if(n<2) { *num1=0;
2015-09-06 01:43:56
520
原创 笔试题:判断一个树是不是平衡二叉树
class Solution {public: int length(TreeNode* t) { if(t==NULL)return 0; return length(t->left)>length(t->right)?length(t->left)+1:length(t->right)+1; } bool IsBlance(Tr
2015-09-06 01:01:44
512
原创 笔试题:删除链表中重复的节点
#include <iostream>#include <queue>using namespace std;struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) { }};class Solution {public:
2015-09-05 14:29:06
587
原创 笔试题:扑克牌顺子
题目描述LL今天心情特别好,因为他去买了一副扑克牌,发现里面居然有2个大王,2个小王(一副牌原本是54张^_^)…他随机从中抽出了5张牌,想测测自己的手气,看看能不能抽到顺子,如果抽到的话,他决定去买体育彩票,嘿嘿!!“红心A,黑桃3,小王,大王,方片5”,“Oh My God!”不是顺子…..LL不高兴了,他想了想,决定大\小 王可以看成任何数字,并且A看作1,J为11,Q为12,K为13。上面的
2015-09-05 01:18:36
1142
原创 笔试题:求数组中和为sum的乘积最小的一对组合
#include <iostream>#include <vector>using namespace std;class Solution {public: vector<int> FindNumbersWithSum(vector<int> array, int sum) { //1 2 3 4 5 6 7 int i = 0; in
2015-09-05 00:42:59
865
原创 笔试题:求和为sum的连续数列
#include #include using namespace std;class Solution {public: vector > FindContinuousSequence(int sum){ int index; //思想: //(y-x+1)=n; //(x+y)*n/2=sum; //--->(2*x-1+n)=2*sum/n; //--->2
2015-09-04 23:31:55
696
原创 笔试题:求二叉树第n层的节点数。
#include <iostream>#include <string.h>using namespace std;template<typename T>struct Node{ T data; Node<T> *left; Node<T> *right; Node(T d = T()) :data(d), left(NULL), right(NULL){}
2015-09-04 01:00:55
1690
原创 欢迎来挑战:极限打印99乘法表
#include <iostream>using namespace std;int main(){ //凡是有两个for,while循环的,有 if,有?:的,有Switch的全部Out! int count = 1; int sum = (1 + 9) * 9 / 2; int flags = 1; for (int i = 1; i <= sum;
2015-09-03 15:34:50
814
原创 笔试题:逆序一个栈的递归与非递归实现
//非递归实现。#include <iostream>#include <stack>using namespace std;void Deal(stack<int> &st,int val){ stack<int> temp; while(st.empty()==false) { temp.push(st.top()); st.pop
2015-09-01 13:59:52
421
原创 笔试题:判断栈的push(),pop()序列是否正确
#include <iostream>#include <stack>using namespace std;bool Grial(int a[],int n,int b[],int m){ if(n!=m)return false; stack<int> st; int j = 0; for(int i=0;i<n;i++) { st.
2015-09-01 11:12:21
631
原创 笔试题:用两个栈实现队列
#include <iostream>#include <stack>using namespace std;template<typename T>class QUEUE{ public: QUEUE(){} ~QUEUE(){} void APPEND(const T val) { while(st2.empty()==false)
2015-09-01 00:56:00
808
原创 笔试题:乱序求第n大(小)的数。我能想到的最好的方法。
#include using namespace std;//当然用快速排序也是一样的。class Heap{ public: Heap(){} void Insert(int a[],int len,int N) { data = new int[N]; size = N; for(int i=0;i<N;i++) { data[i]=a[i]; }
2015-09-01 00:05:03
1017
1
原创 笔试题:求二叉树中和值为sum的所有路径
#include <iostream>#include <stack>using namespace std;struct Node{ Node *left; Node *right; int data; Node(int d = int()) :data(d), left(NULL), right(NULL){}};class DataTree{pub
2015-08-31 20:38:24
1120
原创 笔试题:由两个栈构造min栈
#include <iostream>#include <stack>using namespace std;template<typename T>class Min{public: void PUSH(T val) { T temp = val; st1.push(val); if (st2.empty() == true
2015-08-31 19:49:42
564
原创 笔试题:用二叉树构造双向链表
#include <iostream>#include <string.h>using namespace std;struct Node{ Node *left;//相当于双向链表的prev指针。 Node *right;//相当于双向链表的next指针。 char data; Node(char d = char()):data(d),left(NULL)
2015-08-31 16:43:47
733
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人