• 深度优先与广度优先


    # 广度优先
    # 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'>]
    '''
  • 相关阅读:
    Leetcode No.108 Convert Sorted Array to Binary Search Tree(c++实现)
    Leetcode No.88 Merge Sorted Array(c++实现)
    Leetcode No.66 Plus One(c++实现)
    pandas数据排序(series排序 & DataFrame排序)
    pandas的settingwithWaring报警
    pandas对缺失值的处理
    pandas的数据统计函数
    pandas 新增数据列(直接赋值、apply,assign、分条件赋值)
    pandas数据查询(数值、列表、区间、条件、函数)
    pandas数据读取(DataFrame & Series)
  • 原文地址:https://www.cnblogs.com/0B0S/p/12088318.html
Copyright © 2020-2023  润新知