摘要: Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is.You may not alter the values in the nodes, only nodes itself may be changed.Only constant memory is all 阅读全文
posted @ 2013-11-25 22:29 七年之后 阅读(182) 评论(0) 推荐(0) 编辑
摘要: Divide two integers without using multiplication, division and mod operator.思考:位运算。AC的时候真的想说一句“尼玛。。“,用unsigned int 超时,莫名其妙,折腾到半夜,百度一下改为long long过了。。我也不明白到底怎么回事,毕竟不是CS出身,哎。。太晚了,明天再看。VC不支持long long,珍爱生命,远离VC。class Solution {public: int divide(int dividend, int divisor) { // IMPORTANT: Please... 阅读全文
posted @ 2013-11-25 01:49 七年之后 阅读(386) 评论(0) 推荐(0) 编辑