zoukankan      html  css  js  c++  java
  • 深度优先与广度优先

    # 广度优先
    # class A(object):
    # def test(self):
    # print('from A')
    # class B(A):
    # def test(self):
    # print('from B')
    # class C(A):
    # def test(self):
    # print('from C')
    # class D(B):
    # def test(self):
    # print('from D')
    # class E(C):
    # def test(self):
    # print('from E')
    # class F(D,E):
    # def test(self):
    # print('from F')
    # pass
    # f1=F()
    # f1.test()
    '''
    from F
    '''
    # class A(object):
    # def test(self):
    # print('from A')
    # class B(A):
    # def test(self):
    # print('from B')
    # class C(A):
    # def test(self):
    # print('from C')
    # class D(B):
    # def test(self):
    # print('from D')
    # class E(C):
    # def test(self):
    # print('from E')
    # class F(D,E):
    # # def test(self):
    # # print('from F')
    # pass
    # f1=F()
    # f1.test()
    '''
    from D
    '''
    # class A(object):
    # def test(self):
    # print('from A')
    # class B(A):
    # def test(self):
    # print('from B')
    # class C(A):
    # def test(self):
    # print('from C')
    # class D(B):
    # # def test(self):
    # # print('from D')
    # pass
    # class E(C):
    # def test(self):
    # print('from E')
    # class F(D,E):
    # # def test(self):
    # # print('from F')
    # pass
    # f1=F()
    # f1.test()
    '''
    from B
    '''
    # class A(object):
    # def test(self):
    # print('from A')
    # class B(A):
    # # def test(self):
    # # print('from B')
    # pass
    # class C(A):
    # def test(self):
    # print('from C')
    # class D(B):
    # # def test(self):
    # # print('from D')
    # pass
    # class E(C):
    # def test(self):
    # print('from E')
    # class F(D,E):
    # # def test(self):
    # # print('from F')
    # pass
    # f1=F()
    # f1.test()
    '''
    from E
    '''
    # class A(object):
    # def test(self):
    # print('from A')
    # class B(A):
    # # def test(self):
    # # print('from B')
    # pass
    # class C(A):
    # def test(self):
    # print('from C')
    # class D(B):
    # # def test(self):
    # # print('from D')
    # pass
    # class E(C):
    # # def test(self):
    # # print('from E')
    # pass
    # class F(D,E):
    # # def test(self):
    # # print('from F')
    # pass
    # f1=F()
    # f1.test()
    '''
    from C
    '''
    # class A(object):
    # def test(self):
    # print('from A')
    # class B(A):
    # # def test(self):
    # # print('from B')
    # pass
    # class C(A):
    # # def test(self):
    # # print('from C')
    # pass
    # class D(B):
    # # def test(self):
    # # print('from D')
    # pass
    # class E(C):
    # # def test(self):
    # # print('from E')
    # pass
    # class F(D,E):
    # # def test(self):
    # # print('from F')
    # pass
    # f1=F()
    # f1.test()
    '''
    from A
    '''
    # class A(object):
    # def test(self):
    # print('from A')
    # class B(A):
    # # def test(self):
    # # print('from B')
    # pass
    # class C(A):
    # # def test(self):
    # # print('from C')
    # pass
    # class D(B):
    # # def test(self):
    # # print('from D')
    # pass
    # class E(C):
    # # def test(self):
    # # print('from E')
    # pass
    # class F(D,E):
    # # def test(self):
    # # print('from F')
    # pass
    # f1=F()
    # print(F.mro())
    '''
    [<class '__main__.F'>, <class '__main__.D'>, <class '__main__.B'>, <class '__main__.E'>, <class '__main__.C'>, <class '__main__.A'>, <class 'object'>]
    '''
  • 相关阅读:
    [C++] const 限定符
    [国嵌笔记][028][Bootloader设计蓝图]
    [国嵌笔记][027][ARM协处理器访问指令]
    [国嵌笔记][026][ARM伪指令]
    [国嵌笔记][025][ARM指令分类学习]
    [国嵌笔记][024][ARM汇编编程概述]
    [国嵌笔记][023][ARM寻址方式]
    [国嵌笔记][021-022][ARM处理器工作模式]
    [国嵌笔记][020][ARM家族大检阅]
    [国嵌笔记][019][Eclipse集成开发环境]
  • 原文地址:https://www.cnblogs.com/0B0S/p/12088318.html
Copyright © 2011-2022 走看看