摘要:
1 #include 2 #include 3 #include 4 using namespace std; 5 6 int cnk(int n, int k) 7 { 8 int a,b; 9 a=b=1;10 for(int i=0; i0)28 {... 阅读全文
摘要:
1 #include 2 #include 3 #include 4 using namespace std; 5 6 struct GT_cls //创建函数对象 7 { 8 public: 9 GT_cls(int t=0):a(t){}10 11 bool operat... 阅读全文
摘要:
要求实现函数:void converse(ListNode **head);【输入】head: 链表头节点,空间已经开辟好【输出】head: 逆序后的链表头节点【返回】无【注意】只需要完成该函数功能算法,中间不需要有任何IO的输入输出示例输入:链表 1->2->3->4->5 的头节点head输出:... 阅读全文
摘要:
1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 10 int calculator(string s) 11 { 12 ... 阅读全文
摘要:
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 you climb... 阅读全文
摘要:
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 / \ ... 阅读全文
摘要:
Given a stringSand a stringT, count the number of distinct subsequences ofTinS.A subsequence of a string is a new string which is formed from the orig... 阅读全文
摘要:
Say you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to complete at most one transaction (ie... 阅读全文