leetcode 94 binary tree inorder traversal
Given a binary tree, return the inorder traversal of its nodes’ values.
Example:
1 | Input: [1,null,2,3] |
later equals never
Given a binary tree, return the inorder traversal of its nodes’ values.
Example:
1 | Input: [1,null,2,3] |
Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'.
1 | '.' Matches any single character. |
The matching should cover the entire input string (not partial).
线性表、链表、栈和队列是编程中常用的数据结构。
逻辑结构:是数据的组织形式,用来表示数据之间的逻辑关系,其结构由数据元素的集合和元素之间的关系组成。
三种基本逻辑结构
抽象类
如果父类方法无需实现功能,仅仅是为了定义签名,目的是让子类去覆写,那么可以把父类的方法声明为抽象方法。
含有抽象方法的类必须定义为抽象类,无法实例化。
抽象类本身被设计成只能继承,因此,抽象类可以强迫子类实现其定义的抽象方法,否则编译会报错,相当于定义了规范。
被注入对象可通过在其构造方法中声明依赖对象的参数列表,让外部(IoC容器)知道它需要哪些依赖对象。
1 | public NewsProvider(NewsListener newsListener,NewsPublisher newsPublisher){ |
This structure might apply to many other backtracking questions,here are just some examples to demonstrate Subsets, Permutations, and Combination Sum.