上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 17 下一页

2019年10月13日

lecture 10.11

摘要: 1. struct中的pointer: 下面两者实现的功能是不一样的: (a) *wp.salary=12500 (b) w.salary=12500 因为.的优先级更高,所以(b)会被翻译为*(wp.salary)=12500 所以应该写成*(wp).salary=12500或者wp->salar 阅读全文

posted @ 2019-10-13 17:24 Eleni 阅读(176) 评论(1) 推荐(0) 编辑

2019年10月10日

functions and Big-O notation

摘要: 1. functions: f : S → T, is a binary relation f ⊆ S ×T such that for all s ∈ S there is exactly one t ∈ T such that (s,t) ∈ f unique element related t 阅读全文

posted @ 2019-10-10 10:44 Eleni 阅读(194) 评论(0) 推荐(0) 编辑

Dynamic Data Structures

摘要: 1. 问题:给定集合S,是否能找到subset使其加和为1000 方法一:用n bits表示集合中的所有元素,每一个bit代表集合中的一个元素,如果bit取值为1则A[i]属于subset,反之不属于 如:A[ ]={1,2,3,5}, 则1100表示subset={1,2} 共有2n种情况,故而时 阅读全文

posted @ 2019-10-10 10:19 Eleni 阅读(331) 评论(1) 推荐(0) 编辑

作业出现的问题

摘要: 1. for循环里所有的执行语句都要放在{ }中 2. 如果在compile中没有报错,但是在execute中出现错误提示LINK : fatal error LNK1168: cannot open Debug/question1.exe for writingError executing li 阅读全文

posted @ 2019-10-10 06:46 Eleni 阅读(181) 评论(0) 推荐(0) 编辑

2019年10月8日

week 1 problem set

摘要: 1 # include 2 int choose(int n); 3 int main() 4 { 5 int i=2,a=1,b=1,c=2; 6 printf("%d\n%d\n",a,b); 7 for (i=2;i<=10;i++) 8 { 9 c=a+b; 10 a=b; 11 b=c;... 阅读全文

posted @ 2019-10-08 13:30 Eleni 阅读(153) 评论(0) 推荐(0) 编辑

右复合及映射

摘要: 1. 设F,G为二元关系,G对F的右复合记作FoG,其中F是复合到G上的第二步作用 2. 若(值域)ranf=B,则称f:A→B是surjective 若different input can get different output,则称f:A→B是injective 若f:A→B既是surjec 阅读全文

posted @ 2019-10-08 09:15 Eleni 阅读(2797) 评论(0) 推荐(0) 编辑

2019年10月7日

C语言练习总结

摘要: 1. str更为直观的初始化方法为: char c[]={"I am happy"}; char c[]="I am happy"; 2. 调用strlen函数计算字符串的长度,不包括结束字符,用到的标准库为<string.h>: 上面代码返回的结果为7。需要注意的是,strlen的返回结果为siz 阅读全文

posted @ 2019-10-07 12:06 Eleni 阅读(208) 评论(1) 推荐(0) 编辑

2019年10月5日

binary relations

摘要: 1. 2. give examples of relations with specified properties, S, not R, not T example: inequality 3. equivalence relations Reflexive; Symmetric; Transit 阅读全文

posted @ 2019-10-05 14:04 Eleni 阅读(836) 评论(0) 推荐(0) 编辑

2019年10月4日

9020quiz总结

摘要: quiz 1 1. For all m,n ∈ ℕ>0 and all a,b ∈ ℤ: if a = b (mod m) and a = b (mod n) then a = b (mod mn) answer: False 如17和5关于2同余1,关于4同余1,但是2*4=8,17和5不关于8同 阅读全文

posted @ 2019-10-04 21:49 Eleni 阅读(631) 评论(0) 推荐(0) 编辑

2019年10月3日

analysis of algorithms

摘要: 1. 2. binary search (sorted array) 给定查找对象,array,以及最大最小的范围;将查找对象与middle作比较,进而改变最大最小的范围,然后调用递归 时间复杂度的计算要考虑最坏的情况,本题中最坏的情况类比一条面包每天吃一半几天吃完的问题,时间复杂度为log以2为底 阅读全文

posted @ 2019-10-03 16:34 Eleni 阅读(187) 评论(0) 推荐(0) 编辑

上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 17 下一页

导航