摘要: package org.skyeye.test; import org.springframework.util.Assert; public class NodeAdd { public static class Node{ int data; Node next; public static enum N... 阅读全文
posted @ 2018-05-16 16:56 淡季的风 阅读(1004) 评论(0) 推荐(0) 编辑
摘要: 比如 1->2->4->6->7 + 3->4->5 => 1->2->8->1>2 思想是先把两个链表反转, 从低位相加, 得到结果, 再反转回来#! /usr/bin/env python# -*- coding: utf-8 -*- 阅读全文
posted @ 2018-05-16 16:03 淡季的风 阅读(343) 评论(0) 推荐(0) 编辑
摘要: class Node(object): def __init__(self, data, next): self.data = data self.next = next def reverse(head): if head is None or head.next is None: return head pre ... 阅读全文
posted @ 2018-05-16 15:10 淡季的风 阅读(123) 评论(0) 推荐(0) 编辑