把两个链表加起来 add two numbers represented by two linked lists
2014-11-27 09:40
375 查看
把两个链表加起来 add two numbers represented by two linked lists
如果从链表的头到尾是数字的低位到高位的方向,这道题非常好做,详见:http://www.geeksforgeeks.org/add-two-numbers-represented-by-linked-lists/。
如果从链表的头到尾是数字的高位到低位的方向,那么可以先把这两个链表反转,然后把它们相加得到结果,最后把三个链表反转,就可以得到最后结果。
如果从链表的头到尾是数字的低位到高位的方向,这道题非常好做,详见:http://www.geeksforgeeks.org/add-two-numbers-represented-by-linked-lists/。
如果从链表的头到尾是数字的高位到低位的方向,那么可以先把这两个链表反转,然后把它们相加得到结果,最后把三个链表反转,就可以得到最后结果。
相关文章推荐
- Add two numbers represented by linked lists
- Add two numbers represented by linked lists | Set 2
- [置顶] LeetCode--Intersection of Two Linked Lists (两个链表的交点)Python
- 两个链表的数字相加(简单题) add two numbers
- Leetcode Add Two Numbers 两个链表表示的数相加
- (LeetCode)Intersection of Two Linked Lists --- 两个链表的交集
- (leetcode)2. 两个链表相加Add Two Numbers--Java
- 【小熊刷题】Add Two Numbers in Linked Lists
- LeetCode--Add Two Numbers(求两个链表的和)Python
- LeetCode 160. Intersection of Two Linked Lists (两个链表的交点)
- LeetCode 160. Intersection of Two Linked Lists(两个链表的第一个公共结点)
- LeetCode | Add Two Numbers(两个链表相加)
- [leetcode]Intersection of Two Linked Lists[java]找出两个链表的公共节点
- LeetCode---(160)Intersection of Two Linked Lists判断两个链表是否相交
- 【leetcode 两个链表的交集点】Intersection of Two Linked Lists
- 160. Intersection of Two Linked Lists (求两个链表的交集)
- Intersection of Two Linked Lists:寻找两个链表的交汇点
- 【12】Adds two numbers represented by a linked list and returns the sum as a linked list
- leetcode 5. 两个链表逐个元素相加 Add Two Numbers
- Lettcode_160_Intersection of Two Linked Lists ——寻找两个链表的第一个交汇点