摘要:
What’s iterator?template classGeneric PointerGetting an iterator1 auto itr=container.cbegin();2 auto itr=container.cend();Iterator methods1 ++itr2 *it... 阅读全文
摘要:
Question:Given intergers A1,A2,…,An,find the maximum Subsequence Sum ProblemSolution:有很多方法可以解决这个问题。下面我只给出我认为最好的算法。 1 //linear-time maximum contiguous ... 阅读全文
摘要:
Question:Given an interger X and intergers A0,A1,……,A(n-1), which are presorted and already in memory,find i such that Ai=X, or return i=-1 if X is no... 阅读全文
摘要:
list简介#inlude 实质为双向链表是类模板实例化example: 1 //instantiate an empty list 2 list listA; 3 4 //instantiate a list with 7 intergers,each initialized to 0 5 li... 阅读全文