05 2018 档案

摘要:1. python 装饰器 1) 2层装饰器 2) 3层装饰器 此处a,b可为任意指定参数,但不可以更改。 3) 类装饰器, python中类本身是不可调用的, 需要实现__call__方法, 将类变为callable。 python装饰器使用闭包的方式提供aop的概念。不过需要注意,装饰器装饰的函 阅读全文
posted @ 2018-05-28 11:04 淡季的风 阅读(2006) 评论(0) 推荐(0)
摘要:1. 递归 2. 栈 阅读全文
posted @ 2018-05-24 15:46 淡季的风 阅读(1413) 评论(0) 推荐(0)
摘要: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 淡季的风 阅读(1032) 评论(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 淡季的风 阅读(362) 评论(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 淡季的风 阅读(128) 评论(0) 推荐(0)