2017年12月27日

c++-swap nodes in pairs

摘要: 题目描述Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2... 阅读全文

posted @ 2017-12-27 22:23 sichenzhao 阅读(110) 评论(0) 推荐(0) 编辑

c++-成员初始化问题(static, const, 引用)

摘要: 有一个类B继承自类A,他们数据成员如下:classA {...private: int&a;};classB : publicA {...private: inta;public: constint b; A c; staticco... 阅读全文

posted @ 2017-12-27 15:16 sichenzhao 阅读(182) 评论(0) 推荐(0) 编辑

c++-merge k sorted lists heap的灵活应用

摘要: 题目描述Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.思路有很多1.先将这些链表转化为一个vector int型的数组... 阅读全文

posted @ 2017-12-27 13:28 sichenzhao 阅读(102) 评论(0) 推荐(0) 编辑

导航