From f173cd0e33f76add6ab21e71a4ffe3ef7bfdd64b Mon Sep 17 00:00:00 2001
From: "tianqing.liang" <1>
Date: Tue, 14 Sep 2021 08:59:38 +0800
Subject: [PATCH 01/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9readme?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 729f25d..7a4e0f4 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 # AlgorithmAndDataArchitecture
 
-<h2>使用Dart语言重写数据结构与算法</h2>
+<h2>使用Flutter的Dart语言重写数据结构与算法</h2>
 
 1. 线性搜索
 2. 选择排序

From 0131b815db2077d3fd1436def627e31c1e14288f Mon Sep 17 00:00:00 2001
From: "tianqing.liang" <1>
Date: Sun, 19 Sep 2021 14:23:46 +0800
Subject: [PATCH 02/21] =?UTF-8?q?=E5=9B=BE=E7=9A=84=E9=82=BB=E6=8E=A5?=
 =?UTF-8?q?=E7=9F=A9=E9=98=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 25-GraphBascis/AdjMatrix.dart    | 61 ++++++++++++++++++++++++++++++++
 25-GraphBascis/FileOperator.dart | 19 ++++++++++
 25-GraphBascis/g.txt             | 10 ++++++
 README.md                        |  5 ++-
 4 files changed, 94 insertions(+), 1 deletion(-)
 create mode 100644 25-GraphBascis/AdjMatrix.dart
 create mode 100644 25-GraphBascis/FileOperator.dart
 create mode 100644 25-GraphBascis/g.txt

diff --git a/25-GraphBascis/AdjMatrix.dart b/25-GraphBascis/AdjMatrix.dart
new file mode 100644
index 0000000..4b0e581
--- /dev/null
+++ b/25-GraphBascis/AdjMatrix.dart
@@ -0,0 +1,61 @@
+import 'dart:io';
+
+/**
+ * 图的邻接矩阵表示方式
+ *
+ * 注：
+ * 由于原构造方法需要读取文件
+ * dart语言中读取文件是异步方法
+ * dart语言中构造方法是不允许异步
+ *
+ * 所以无法按照原有格式实现，故更换方式
+ *
+ * 先读取文件，将相应数据赋值
+ */
+class AdjMatrix {
+  int? _V;//图的顶点数量
+  int? _E;//图的边的数量
+  List?  _adj;//邻接矩阵
+
+
+  AdjMatrix( V,E,List list) {
+    _V = V;
+    _E = E ;
+
+    _adj = List.generate(V, (_)=>List.generate(V,(_)=> 0),growable: false);
+    for(int i =1;i<E;i++){
+      int a =  int.parse(list[i].split(" ")[0]);
+      int b = int.parse(list[i].split(" ")[1]);
+      _adj![a][b] = 1;
+      _adj![b][a] = 1;
+    }
+  }
+
+  @override
+  String toString() {
+    StringBuffer sb = new StringBuffer();
+    sb.write("V = $_V, E = $_E\n");
+    for (int i = 0; i < _V!; i ++) {
+      for (int j = 0; j < _V!; j ++)
+        sb.write("${_adj![i][j]} ");
+      sb.write('\n');
+    }
+    return sb.toString();
+  }
+
+
+}
+
+void main() async {
+  File content = File("g.txt");
+  List<String> list = await content.readAsLines();
+  //读取到文件的顶点数量以及
+  print(list[0].split(" ")[0]);
+  print(list[0].split(" ")[1]);
+  int v = int.parse(list[0].split(" ")[0]) ;
+  int e = int.parse(list[0].split(" ")[1]) ;
+//
+  AdjMatrix adjMatrix = AdjMatrix(v, e, list);
+  print(adjMatrix);
+
+}
\ No newline at end of file
diff --git a/25-GraphBascis/FileOperator.dart b/25-GraphBascis/FileOperator.dart
new file mode 100644
index 0000000..da2d7a4
--- /dev/null
+++ b/25-GraphBascis/FileOperator.dart
@@ -0,0 +1,19 @@
+import 'dart:io';
+import 'dart:convert';
+
+/**
+ * 文件操作类
+ */
+class FileOperator{
+
+    static Future<List> getFileString(String filename) async{
+      Stream<List<int>> content = File(filename).openRead();
+      List<String> lines = await content.transform(utf8.decoder).transform(LineSplitter()).toList();
+      var words = [];
+      for(int i = 0;i<lines.length;i++){
+        words.addAll(lines[i].split(" ").toList());
+      }
+      words.removeWhere((element) => element == "");
+      return words;
+    }
+}
\ No newline at end of file
diff --git a/25-GraphBascis/g.txt b/25-GraphBascis/g.txt
new file mode 100644
index 0000000..1707a93
--- /dev/null
+++ b/25-GraphBascis/g.txt
@@ -0,0 +1,10 @@
+7 9
+0 1
+0 3
+1 2
+1 6
+2 3
+2 5
+3 4
+4 5
+5 6
\ No newline at end of file
diff --git a/README.md b/README.md
index 7a4e0f4..f5c721c 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,6 @@
 # AlgorithmAndDataArchitecture
 
 <h2>使用Flutter的Dart语言重写数据结构与算法</h2>
-
 1. 线性搜索
 2. 选择排序
 3. 插入排序
@@ -27,6 +26,10 @@
 23. MSD排序，桶排序
 24. 字符串匹配
 
+<h3>图相关的数据结构与算法</h3>
+1. 图的邻接矩阵
+
+
 #### 后续更新
 1. 将图相关的数据结构与算法用dart语言重新实现
 

From e79a80144d7105371311fe553ddc95a3063bf1a6 Mon Sep 17 00:00:00 2001
From: "tianqing.liang" <1>
Date: Sun, 19 Sep 2021 19:13:37 +0800
Subject: [PATCH 03/21] =?UTF-8?q?'=E4=BF=AE=E6=94=B9'?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 25-GraphBascis/AdjMatrix.dart | 37 ++++++++++++++++++++++++++++++++++-
 README.md                     |  1 +
 2 files changed, 37 insertions(+), 1 deletion(-)

diff --git a/25-GraphBascis/AdjMatrix.dart b/25-GraphBascis/AdjMatrix.dart
index 4b0e581..0f2841f 100644
--- a/25-GraphBascis/AdjMatrix.dart
+++ b/25-GraphBascis/AdjMatrix.dart
@@ -21,16 +21,51 @@ class AdjMatrix {
   AdjMatrix( V,E,List list) {
     _V = V;
     _E = E ;
-
+    if(V < 0) throw Exception("V must be non-negative");
+    if(E < 0) throw Exception("E must be non-negative");
     _adj = List.generate(V, (_)=>List.generate(V,(_)=> 0),growable: false);
     for(int i =1;i<E;i++){
       int a =  int.parse(list[i].split(" ")[0]);
+      _validateVertex(a);
       int b = int.parse(list[i].split(" ")[1]);
+      _validateVertex(b);
       _adj![a][b] = 1;
       _adj![b][a] = 1;
     }
   }
 
+  _validateVertex(int v){
+    if(v < 0 || v >= _V!)
+      throw new Exception("vertex  $v is invalid");
+  }
+
+  int? V(){
+    return _V;
+  }
+
+  bool hasEdge(int v, int w){
+    _validateVertex(v);
+    _validateVertex(w);
+    return _adj![v][w] == 1;
+  }
+
+  int _degree(int v){
+    return _adj![v].length;
+  }
+
+  int? E(){
+    return _E;
+  }
+
+  List<int> adj(int v){
+    _validateVertex(v);
+    List<int> res = List.filled(_V!, 0,growable: true);
+    for(int i = 0; i < _V!; i ++)
+      if(_adj![v][i] == 1)
+        res.add(i);
+    return res;
+  }
+
   @override
   String toString() {
     StringBuffer sb = new StringBuffer();
diff --git a/README.md b/README.md
index f5c721c..80edce4 100644
--- a/README.md
+++ b/README.md
@@ -36,3 +36,4 @@
 #### SDK版本
 1. 版本：2.12.3
 2. Java版本课程地址：[慕课网算法与数据结构](https://class.imooc.com/sale/datastructure)
+3. Java版本图课程：[慕课网图论算法](https://coding.imooc.com/class/370.html)

From 8efd84e33a395cd8f09485994a20bc406df8b260 Mon Sep 17 00:00:00 2001
From: SKY_L <2451645776@qq.com>
Date: Sun, 19 Sep 2021 19:19:21 +0800
Subject: [PATCH 04/21] Update README.md

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 80edce4..4b51a13 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 # AlgorithmAndDataArchitecture
 
-<h2>使用Flutter的Dart语言重写数据结构与算法</h2>
+<h3>使用Flutter的Dart语言重写数据结构与算法</h3>
 1. 线性搜索
 2. 选择排序
 3. 插入排序

From 8fc38ce6fbc8e3a9f5fe23f7606cc6177ef1048a Mon Sep 17 00:00:00 2001
From: SKY_L <2451645776@qq.com>
Date: Sun, 19 Sep 2021 19:19:40 +0800
Subject: [PATCH 05/21] Update README.md

---
 README.md | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/README.md b/README.md
index 4b51a13..b26fb3e 100644
--- a/README.md
+++ b/README.md
@@ -25,9 +25,7 @@
 22. 计数排序、LSD基数排序
 23. MSD排序，桶排序
 24. 字符串匹配
-
-<h3>图相关的数据结构与算法</h3>
-1. 图的邻接矩阵
+25. 图的邻接矩阵
 
 
 #### 后续更新

From a4ce6f4720f90d4cc11cd6d49b472a832fc6c46e Mon Sep 17 00:00:00 2001
From: SKY_L <2451645776@qq.com>
Date: Sun, 19 Sep 2021 19:20:09 +0800
Subject: [PATCH 06/21] Update README.md

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index b26fb3e..9e95f69 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,7 @@
 # AlgorithmAndDataArchitecture
 
 <h3>使用Flutter的Dart语言重写数据结构与算法</h3>
+
 1. 线性搜索
 2. 选择排序
 3. 插入排序
@@ -27,7 +28,6 @@
 24. 字符串匹配
 25. 图的邻接矩阵
 
-
 #### 后续更新
 1. 将图相关的数据结构与算法用dart语言重新实现
 

From d0e25331c73c5adc06cb54f7061c56114238a935 Mon Sep 17 00:00:00 2001
From: "tianqing.liang" <1>
Date: Tue, 21 Sep 2021 12:01:07 +0800
Subject: [PATCH 07/21] =?UTF-8?q?=E5=9B=BE=E7=9A=84=E9=82=BB=E6=8E=A5?=
 =?UTF-8?q?=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 25-GraphBascis/AdjList.dart  | 112 +++++++++++++++++++++++++++++++++++
 25-GraphBascis/AdjSet.dart   |  98 ++++++++++++++++++++++++++++++
 25-GraphBascis/ListItem.dart |  14 +++++
 README.md                    |   2 +-
 4 files changed, 225 insertions(+), 1 deletion(-)
 create mode 100644 25-GraphBascis/AdjList.dart
 create mode 100644 25-GraphBascis/AdjSet.dart
 create mode 100644 25-GraphBascis/ListItem.dart

diff --git a/25-GraphBascis/AdjList.dart b/25-GraphBascis/AdjList.dart
new file mode 100644
index 0000000..5c0f0c5
--- /dev/null
+++ b/25-GraphBascis/AdjList.dart
@@ -0,0 +1,112 @@
+import 'dart:collection';
+import 'dart:io';
+
+/**
+ * 图的邻接表
+ * 因为dart自带的LinkedList的LinkedList比较特殊，它不是一个带泛型集合，
+ * 因为它泛型类型上界是LinkedListEntry,
+ * 内部的数据结构实现是一个双链表，
+ * 链表的结点是LinkedListEntry的子类，
+ * 且内部维护了_next和_previous指针。
+ * 它并没有实现List接口
+ * 所以无法在链表的结点是LinkedListEntry的子类中实现List 完成图的邻接表表示方法
+ * 编译器直接报错
+ *
+ */
+class AdjList{
+  int? _V;//图的顶点数量
+  int? _E;//图的边的数量
+  List?  _adj;//邻接矩阵
+  LinkedList? _linkedList;
+
+  AdjList( V,E,List list) {
+    _V = V;
+    _E = E ;
+    if(V < 0) throw Exception("V must be non-negative");
+    if(E < 0) throw Exception("E must be non-negative");
+    _adj = List.generate(V, (_)=>List.generate(V,(_)=> 0),growable: false);
+//    _linkedList = LinkedList<LinkedListEntryImpl>();
+
+    for(int i =1;i<E;i++){
+      int a =  int.parse(list[i].split(" ")[0]);
+      _validateVertex(a);
+      int b = int.parse(list[i].split(" ")[1]);
+      _validateVertex(b);
+      (_linkedList!.elementAt(a) as List)[b] =1;
+      _adj![a][b] = 1;
+      _adj![b][a] = 1;
+//    _linkedList!.toList(growable: true);
+    }
+  }
+
+  _validateVertex(int v){
+    if(v < 0 || v >= _V!)
+      throw new Exception("vertex  $v is invalid");
+  }
+
+  int? V(){
+    return _V;
+  }
+
+  bool hasEdge(int v, int w){
+    _validateVertex(v);
+    _validateVertex(w);
+    return _adj![v][w] == 1;
+  }
+
+  int _degree(int v){
+    return _adj![v].length;
+  }
+
+  int? E(){
+    return _E;
+  }
+
+  List<int> adj(int v){
+    _validateVertex(v);
+    List<int> res = List.filled(_V!, 0,growable: true);
+    for(int i = 0; i < _V!; i ++)
+      if(_adj![v][i] == 1)
+        res.add(i);
+    return res;
+  }
+
+  @override
+  String toString() {
+
+    StringBuffer sb = new StringBuffer();
+    sb.write("V = $_V, E = $_E\n");
+    for (int i = 0; i < _V!; i ++) {
+      for (int j = 0; j < _V!; j ++)
+        sb.write("${_adj![i][j]} ");
+      sb.write('\n');
+    }
+    return sb.toString();
+  }
+}
+
+void main() async {
+  File content = File("g.txt");
+  List<String> list = await content.readAsLines();
+  //读取到文件的顶点数量以及
+  print(list[0].split(" ")[0]);
+  print(list[0].split(" ")[1]);
+  int v = int.parse(list[0].split(" ")[0]) ;
+  int e = int.parse(list[0].split(" ")[1]) ;
+//
+  AdjList adjList= AdjList(v, e, list);
+  print(adjList);
+
+}
+//class LinkedListEntryImpl<List> extends LinkedListEntry<LinkedListEntryImpl<List>> {
+//   List? value;
+//
+//  LinkedListEntryImpl(int length){
+//    value= List.filled(length,0, growable:false);
+//  }
+//
+//  @override
+//  String toString() {
+//    return "value is $value";
+//  }
+//}
\ No newline at end of file
diff --git a/25-GraphBascis/AdjSet.dart b/25-GraphBascis/AdjSet.dart
new file mode 100644
index 0000000..f461f63
--- /dev/null
+++ b/25-GraphBascis/AdjSet.dart
@@ -0,0 +1,98 @@
+import 'dart:collection';
+import 'dart:io';
+
+/**
+ * 图的邻接表
+
+ *
+ */
+class AdjSet {
+  int? _V; //图的顶点数量
+  int? _E; //图的边的数量
+  SplayTreeSet<List<int>>? _treeSet;
+
+  AdjSet(V, E, List list) {
+    _V = V;
+    _E = E;
+    if (V < 0) throw Exception("V must be non-negative");
+    if (E < 0) throw Exception("E must be non-negative");
+    _treeSet = SplayTreeSet<List<int>>();
+
+
+    for (int i = 1; i < E; i++) {
+      int a = int.parse(list[i].split(" ")[0]);
+      _validateVertex(a);
+      int b = int.parse(list[i].split(" ")[1]);
+      _validateVertex(b);
+      _treeSet!.elementAt(a)[b] = 1;
+      _treeSet!.elementAt(b)[a] = 1;
+//      _adj![a][b] = 1;
+//      _adj![b][a] = 1;
+    }
+  }
+
+  _validateVertex(int v) {
+    if (v < 0 || v >= _V!) throw new Exception("vertex  $v is invalid");
+  }
+
+  int? V() {
+    return _V;
+  }
+
+  bool hasEdge(int v, int w) {
+    _validateVertex(v);
+    _validateVertex(w);
+    return _treeSet!.elementAt(v)[w] == 1;
+  }
+
+  int _degree(int v) {
+    return _treeSet!.elementAt(v).length;
+  }
+
+  int? E() {
+    return _E;
+  }
+
+  List<int> adj(int v) {
+    _validateVertex(v);
+    List<int> res = List.filled(_V!, 0, growable: true);
+    for (int i = 0; i < _V!; i++) if (_treeSet!.elementAt(v)[i] == 1) res.add(i);
+    return res;
+  }
+
+  @override
+  String toString() {
+    StringBuffer sb = new StringBuffer();
+    sb.write("V = $_V, E = $_E\n");
+    for (int i = 0; i < _V!; i++) {
+      for (int j = 0; j < _V!; j++) sb.write("${_treeSet!.elementAt(i)[j]} ");
+      sb.write('\n');
+    }
+    return sb.toString();
+  }
+}
+
+void main() async {
+  File content = File("g.txt");
+  List<String> list = await content.readAsLines();
+  //读取到文件的顶点数量以及
+  print(list[0].split(" ")[0]);
+  print(list[0].split(" ")[1]);
+  int v = int.parse(list[0].split(" ")[0]);
+  int e = int.parse(list[0].split(" ")[1]);
+//
+  AdjSet adjList = AdjSet(v, e, list);
+  print(adjList);
+}
+//class LinkedListEntryImpl<List> extends LinkedListEntry<LinkedListEntryImpl<List>> {
+//   List? value;
+//
+//  LinkedListEntryImpl(int length){
+//    value= List.filled(length,0, growable:false);
+//  }
+//
+//  @override
+//  String toString() {
+//    return "value is $value";
+//  }
+//}
diff --git a/25-GraphBascis/ListItem.dart b/25-GraphBascis/ListItem.dart
new file mode 100644
index 0000000..45ad4c2
--- /dev/null
+++ b/25-GraphBascis/ListItem.dart
@@ -0,0 +1,14 @@
+import 'dart:collection';
+
+class LinkedListEntryImpl<int> extends LinkedListEntry<LinkedListEntryImpl<int>> {
+  final int value;
+
+  LinkedListEntryImpl(this.value);
+
+  @override
+  String toString() {
+    return "value is $value";
+  }
+}
+
+
diff --git a/README.md b/README.md
index 9e95f69..7b7a0f3 100644
--- a/README.md
+++ b/README.md
@@ -26,7 +26,7 @@
 22. 计数排序、LSD基数排序
 23. MSD排序，桶排序
 24. 字符串匹配
-25. 图的邻接矩阵
+25. 图的邻接矩阵,邻接表
 
 #### 后续更新
 1. 将图相关的数据结构与算法用dart语言重新实现

From 1d6838cc1fd92761f3bc0e7cdd4822bb16e4d6d8 Mon Sep 17 00:00:00 2001
From: "tianqing.liang" <1>
Date: Wed, 22 Sep 2021 10:51:39 +0800
Subject: [PATCH 08/21] =?UTF-8?q?=E5=9B=BE=E7=9A=84=E9=82=BB=E6=8E=A5?=
 =?UTF-8?q?=E7=9F=A9=E9=98=B5=EF=BC=8C=E9=82=BB=E6=8E=A5=E8=A1=A8=EF=BC=8C?=
 =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 25-GraphBascis/AdjList.dart   | 60 ++++++++++-----------------
 25-GraphBascis/AdjMatrix.dart |  6 ---
 25-GraphBascis/AdjSet.dart    | 39 +++++-------------
 25-GraphBascis/Graph.dart     | 76 +++++++++++++++++++++++++++++++++++
 4 files changed, 109 insertions(+), 72 deletions(-)
 create mode 100644 25-GraphBascis/Graph.dart

diff --git a/25-GraphBascis/AdjList.dart b/25-GraphBascis/AdjList.dart
index 5c0f0c5..17592a0 100644
--- a/25-GraphBascis/AdjList.dart
+++ b/25-GraphBascis/AdjList.dart
@@ -3,39 +3,28 @@ import 'dart:io';
 
 /**
  * 图的邻接表
- * 因为dart自带的LinkedList的LinkedList比较特殊，它不是一个带泛型集合，
- * 因为它泛型类型上界是LinkedListEntry,
- * 内部的数据结构实现是一个双链表，
- * 链表的结点是LinkedListEntry的子类，
- * 且内部维护了_next和_previous指针。
- * 它并没有实现List接口
- * 所以无法在链表的结点是LinkedListEntry的子类中实现List 完成图的邻接表表示方法
- * 编译器直接报错
- *
  */
 class AdjList{
   int? _V;//图的顶点数量
   int? _E;//图的边的数量
   List?  _adj;//邻接矩阵
-  LinkedList? _linkedList;
 
   AdjList( V,E,List list) {
     _V = V;
     _E = E ;
     if(V < 0) throw Exception("V must be non-negative");
     if(E < 0) throw Exception("E must be non-negative");
-    _adj = List.generate(V, (_)=>List.generate(V,(_)=> 0),growable: false);
-//    _linkedList = LinkedList<LinkedListEntryImpl>();
-
+    _adj = List.generate(V, (_)=> LinkedList<LinkedListEntryImpl<int>>(),growable: false);
     for(int i =1;i<E;i++){
       int a =  int.parse(list[i].split(" ")[0]);
       _validateVertex(a);
       int b = int.parse(list[i].split(" ")[1]);
       _validateVertex(b);
-      (_linkedList!.elementAt(a) as List)[b] =1;
-      _adj![a][b] = 1;
-      _adj![b][a] = 1;
-//    _linkedList!.toList(growable: true);
+      var currentLinkedEntryA = LinkedListEntryImpl<int>(a);
+      var currentLinkedEntryB = LinkedListEntryImpl<int>(b);
+
+      _adj![a].add(currentLinkedEntryB);
+      _adj![b].add(currentLinkedEntryA);
     }
   }
 
@@ -51,7 +40,7 @@ class AdjList{
   bool hasEdge(int v, int w){
     _validateVertex(v);
     _validateVertex(w);
-    return _adj![v][w] == 1;
+    return (_adj![v] as LinkedList).contains(w);
   }
 
   int _degree(int v){
@@ -62,13 +51,9 @@ class AdjList{
     return _E;
   }
 
-  List<int> adj(int v){
+  adj(int v){
     _validateVertex(v);
-    List<int> res = List.filled(_V!, 0,growable: true);
-    for(int i = 0; i < _V!; i ++)
-      if(_adj![v][i] == 1)
-        res.add(i);
-    return res;
+    return _adj![v];
   }
 
   @override
@@ -77,8 +62,8 @@ class AdjList{
     StringBuffer sb = new StringBuffer();
     sb.write("V = $_V, E = $_E\n");
     for (int i = 0; i < _V!; i ++) {
-      for (int j = 0; j < _V!; j ++)
-        sb.write("${_adj![i][j]} ");
+      sb.write("节点: $i ");
+      sb.write("${(_adj![i] as LinkedList).toString()} ");
       sb.write('\n');
     }
     return sb.toString();
@@ -98,15 +83,14 @@ void main() async {
   print(adjList);
 
 }
-//class LinkedListEntryImpl<List> extends LinkedListEntry<LinkedListEntryImpl<List>> {
-//   List? value;
-//
-//  LinkedListEntryImpl(int length){
-//    value= List.filled(length,0, growable:false);
-//  }
-//
-//  @override
-//  String toString() {
-//    return "value is $value";
-//  }
-//}
\ No newline at end of file
+class LinkedListEntryImpl<int> extends LinkedListEntry<LinkedListEntryImpl<int>> {
+
+  final int value;
+
+  LinkedListEntryImpl(this.value);
+
+  @override
+  String toString() {
+    return "value is $value";
+  }
+}
\ No newline at end of file
diff --git a/25-GraphBascis/AdjMatrix.dart b/25-GraphBascis/AdjMatrix.dart
index 0f2841f..ff5752a 100644
--- a/25-GraphBascis/AdjMatrix.dart
+++ b/25-GraphBascis/AdjMatrix.dart
@@ -4,12 +4,6 @@ import 'dart:io';
  * 图的邻接矩阵表示方式
  *
  * 注：
- * 由于原构造方法需要读取文件
- * dart语言中读取文件是异步方法
- * dart语言中构造方法是不允许异步
- *
- * 所以无法按照原有格式实现，故更换方式
- *
  * 先读取文件，将相应数据赋值
  */
 class AdjMatrix {
diff --git a/25-GraphBascis/AdjSet.dart b/25-GraphBascis/AdjSet.dart
index f461f63..95d6a88 100644
--- a/25-GraphBascis/AdjSet.dart
+++ b/25-GraphBascis/AdjSet.dart
@@ -3,31 +3,27 @@ import 'dart:io';
 
 /**
  * 图的邻接表
-
  *
  */
 class AdjSet {
   int? _V; //图的顶点数量
   int? _E; //图的边的数量
-  SplayTreeSet<List<int>>? _treeSet;
+  List? _treeSet;
 
   AdjSet(V, E, List list) {
     _V = V;
     _E = E;
     if (V < 0) throw Exception("V must be non-negative");
     if (E < 0) throw Exception("E must be non-negative");
-    _treeSet = SplayTreeSet<List<int>>();
-
+    _treeSet = List.generate(V, (_) => SplayTreeSet<int>(), growable: false);
 
     for (int i = 1; i < E; i++) {
       int a = int.parse(list[i].split(" ")[0]);
       _validateVertex(a);
       int b = int.parse(list[i].split(" ")[1]);
       _validateVertex(b);
-      _treeSet!.elementAt(a)[b] = 1;
-      _treeSet!.elementAt(b)[a] = 1;
-//      _adj![a][b] = 1;
-//      _adj![b][a] = 1;
+      (_treeSet![a] as SplayTreeSet).add(b);
+      (_treeSet![b] as SplayTreeSet).add(a);
     }
   }
 
@@ -42,30 +38,29 @@ class AdjSet {
   bool hasEdge(int v, int w) {
     _validateVertex(v);
     _validateVertex(w);
-    return _treeSet!.elementAt(v)[w] == 1;
+    return (_treeSet![v] as SplayTreeSet).elementAt(w) == 1;
   }
 
   int _degree(int v) {
-    return _treeSet!.elementAt(v).length;
+    return _treeSet![v].length;
   }
 
   int? E() {
     return _E;
   }
 
-  List<int> adj(int v) {
+  adj(int v) {
     _validateVertex(v);
-    List<int> res = List.filled(_V!, 0, growable: true);
-    for (int i = 0; i < _V!; i++) if (_treeSet!.elementAt(v)[i] == 1) res.add(i);
-    return res;
+    return _treeSet![v];
   }
 
   @override
   String toString() {
     StringBuffer sb = new StringBuffer();
     sb.write("V = $_V, E = $_E\n");
-    for (int i = 0; i < _V!; i++) {
-      for (int j = 0; j < _V!; j++) sb.write("${_treeSet!.elementAt(i)[j]} ");
+    for (int j = 0; j < _V!; j++) {
+      sb.write("节点：$j ");
+      sb.write("${_treeSet![j].toString()} ");
       sb.write('\n');
     }
     return sb.toString();
@@ -84,15 +79,3 @@ void main() async {
   AdjSet adjList = AdjSet(v, e, list);
   print(adjList);
 }
-//class LinkedListEntryImpl<List> extends LinkedListEntry<LinkedListEntryImpl<List>> {
-//   List? value;
-//
-//  LinkedListEntryImpl(int length){
-//    value= List.filled(length,0, growable:false);
-//  }
-//
-//  @override
-//  String toString() {
-//    return "value is $value";
-//  }
-//}
diff --git a/25-GraphBascis/Graph.dart b/25-GraphBascis/Graph.dart
new file mode 100644
index 0000000..4931128
--- /dev/null
+++ b/25-GraphBascis/Graph.dart
@@ -0,0 +1,76 @@
+import 'dart:collection';
+import 'dart:io';
+class Graph{
+  int? _V; //图的顶点数量
+  int? _E; //图的边的数量
+  List? _treeSet;
+
+  Graph(V, E, List list) {
+    _V = V;
+    _E = E;
+    if (V < 0) throw Exception("V must be non-negative");
+    if (E < 0) throw Exception("E must be non-negative");
+    _treeSet = List.generate(V, (_) => SplayTreeSet<int>(), growable: false);
+
+    for (int i = 1; i < E; i++) {
+      int a = int.parse(list[i].split(" ")[0]);
+      _validateVertex(a);
+      int b = int.parse(list[i].split(" ")[1]);
+      _validateVertex(b);
+      (_treeSet![a] as SplayTreeSet).add(b);
+      (_treeSet![b] as SplayTreeSet).add(a);
+    }
+  }
+
+  _validateVertex(int v) {
+    if (v < 0 || v >= _V!) throw new Exception("vertex  $v is invalid");
+  }
+
+  int? V() {
+    return _V;
+  }
+
+  bool hasEdge(int v, int w) {
+    _validateVertex(v);
+    _validateVertex(w);
+    return (_treeSet![v] as SplayTreeSet).contains(w);
+  }
+
+  int _degree(int v) {
+    return _treeSet![v].length;
+  }
+
+  int? E() {
+    return _E;
+  }
+
+  adj(int v) {
+    _validateVertex(v);
+    return _treeSet![v];
+  }
+
+  @override
+  String toString() {
+    StringBuffer sb = new StringBuffer();
+    sb.write("V = $_V, E = $_E\n");
+    for (int j = 0; j < _V!; j++) {
+      sb.write("节点：$j ");
+      sb.write("${_treeSet![j].toString()} ");
+    sb.write('\n');
+    }
+    return sb.toString();
+  }
+}
+void main() async {
+  File content = File("g.txt");
+  List<String> list = await content.readAsLines();
+  //读取到文件的顶点数量以及
+  print(list[0].split(" ")[0]);
+  print(list[0].split(" ")[1]);
+  int v = int.parse(list[0].split(" ")[0]) ;
+  int e = int.parse(list[0].split(" ")[1]) ;
+//
+  Graph adjList= Graph(v, e, list);
+  print(adjList);
+
+}

From f67315c203557dae6ceaf022c822efaa923f727b Mon Sep 17 00:00:00 2001
From: "tianqing.liang" <1>
Date: Wed, 22 Sep 2021 16:54:00 +0800
Subject: [PATCH 09/21] =?UTF-8?q?=E5=9B=BE=E7=9A=84=E6=B7=B1=E5=BA=A6?=
 =?UTF-8?q?=E4=BC=98=E5=85=88=E9=81=8D=E5=8E=86=EF=BC=8C=E5=B9=BF=E5=BA=A6?=
 =?UTF-8?q?=E4=BC=98=E5=85=88=E9=81=8D=E5=8E=86=EF=BC=8C=E4=BB=A5=E5=8F=8A?=
 =?UTF-8?q?=E7=9B=B8=E5=BA=94=E7=9A=84=E5=BA=94=E7=94=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 25-GraphBascis/AdjList.dart                   |  2 +-
 25-GraphBascis/AdjMatrix.dart                 |  2 +-
 25-GraphBascis/AdjSet.dart                    |  2 +-
 25-GraphBascis/Graph.dart                     |  2 +-
 25-GraphBascis/g.txt                          | 13 ++-
 26-GraphDFS/AdjMatrix.dart                    | 90 +++++++++++++++++++
 26-GraphDFS/AdjMatrixDFS.dart                 | 61 +++++++++++++
 26-GraphDFS/ArrayStack.dart                   | 46 ++++++++++
 26-GraphDFS/Graph.dart                        | 80 +++++++++++++++++
 26-GraphDFS/GraphDFS.dart                     | 61 +++++++++++++
 26-GraphDFS/GraphDFSnr.dart                   | 56 ++++++++++++
 26-GraphDFS/Stack.dart                        |  7 ++
 26-GraphDFS/g.txt                             |  7 ++
 .../BipartitionDetection.dart                 | 79 ++++++++++++++++
 27-GraphDFS-Application/CC.dart               | 80 +++++++++++++++++
 27-GraphDFS-Application/CycleDetection.dart   | 65 ++++++++++++++
 27-GraphDFS-Application/Graph.dart            | 80 +++++++++++++++++
 27-GraphDFS-Application/GraphDFS.dart         | 59 ++++++++++++
 27-GraphDFS-Application/SingleSourcePath.dart | 65 ++++++++++++++
 27-GraphDFS-Application/g.txt                 |  7 ++
 27-GraphDFS-Application/g2.txt                |  6 ++
 27-GraphDFS-Application/g3.txt                |  5 ++
 28-Graph-BFS/BipartitionDetection.dart        | 88 ++++++++++++++++++
 28-Graph-BFS/CC.dart                          | 85 ++++++++++++++++++
 28-Graph-BFS/CycleDetection.dart              | 81 +++++++++++++++++
 28-Graph-BFS/Graph.dart                       | 80 +++++++++++++++++
 28-Graph-BFS/GraphBFS.dart                    | 56 ++++++++++++
 28-Graph-BFS/SingleSourcePath.dart            | 77 ++++++++++++++++
 28-Graph-BFS/g.txt                            |  7 ++
 28-Graph-BFS/g2.txt                           |  6 ++
 28-Graph-BFS/g3.txt                           |  5 ++
 README.md                                     | 11 +++
 32 files changed, 1359 insertions(+), 12 deletions(-)
 create mode 100644 26-GraphDFS/AdjMatrix.dart
 create mode 100644 26-GraphDFS/AdjMatrixDFS.dart
 create mode 100644 26-GraphDFS/ArrayStack.dart
 create mode 100644 26-GraphDFS/Graph.dart
 create mode 100644 26-GraphDFS/GraphDFS.dart
 create mode 100644 26-GraphDFS/GraphDFSnr.dart
 create mode 100644 26-GraphDFS/Stack.dart
 create mode 100644 26-GraphDFS/g.txt
 create mode 100644 27-GraphDFS-Application/BipartitionDetection.dart
 create mode 100644 27-GraphDFS-Application/CC.dart
 create mode 100644 27-GraphDFS-Application/CycleDetection.dart
 create mode 100644 27-GraphDFS-Application/Graph.dart
 create mode 100644 27-GraphDFS-Application/GraphDFS.dart
 create mode 100644 27-GraphDFS-Application/SingleSourcePath.dart
 create mode 100644 27-GraphDFS-Application/g.txt
 create mode 100644 27-GraphDFS-Application/g2.txt
 create mode 100644 27-GraphDFS-Application/g3.txt
 create mode 100644 28-Graph-BFS/BipartitionDetection.dart
 create mode 100644 28-Graph-BFS/CC.dart
 create mode 100644 28-Graph-BFS/CycleDetection.dart
 create mode 100644 28-Graph-BFS/Graph.dart
 create mode 100644 28-Graph-BFS/GraphBFS.dart
 create mode 100644 28-Graph-BFS/SingleSourcePath.dart
 create mode 100644 28-Graph-BFS/g.txt
 create mode 100644 28-Graph-BFS/g2.txt
 create mode 100644 28-Graph-BFS/g3.txt

diff --git a/25-GraphBascis/AdjList.dart b/25-GraphBascis/AdjList.dart
index 17592a0..c331c75 100644
--- a/25-GraphBascis/AdjList.dart
+++ b/25-GraphBascis/AdjList.dart
@@ -15,7 +15,7 @@ class AdjList{
     if(V < 0) throw Exception("V must be non-negative");
     if(E < 0) throw Exception("E must be non-negative");
     _adj = List.generate(V, (_)=> LinkedList<LinkedListEntryImpl<int>>(),growable: false);
-    for(int i =1;i<E;i++){
+    for(int i =1;i<=E;i++){
       int a =  int.parse(list[i].split(" ")[0]);
       _validateVertex(a);
       int b = int.parse(list[i].split(" ")[1]);
diff --git a/25-GraphBascis/AdjMatrix.dart b/25-GraphBascis/AdjMatrix.dart
index ff5752a..25b66ad 100644
--- a/25-GraphBascis/AdjMatrix.dart
+++ b/25-GraphBascis/AdjMatrix.dart
@@ -18,7 +18,7 @@ class AdjMatrix {
     if(V < 0) throw Exception("V must be non-negative");
     if(E < 0) throw Exception("E must be non-negative");
     _adj = List.generate(V, (_)=>List.generate(V,(_)=> 0),growable: false);
-    for(int i =1;i<E;i++){
+    for(int i =1;i<=E;i++){
       int a =  int.parse(list[i].split(" ")[0]);
       _validateVertex(a);
       int b = int.parse(list[i].split(" ")[1]);
diff --git a/25-GraphBascis/AdjSet.dart b/25-GraphBascis/AdjSet.dart
index 95d6a88..c670f82 100644
--- a/25-GraphBascis/AdjSet.dart
+++ b/25-GraphBascis/AdjSet.dart
@@ -17,7 +17,7 @@ class AdjSet {
     if (E < 0) throw Exception("E must be non-negative");
     _treeSet = List.generate(V, (_) => SplayTreeSet<int>(), growable: false);
 
-    for (int i = 1; i < E; i++) {
+    for (int i = 1; i <= E; i++) {
       int a = int.parse(list[i].split(" ")[0]);
       _validateVertex(a);
       int b = int.parse(list[i].split(" ")[1]);
diff --git a/25-GraphBascis/Graph.dart b/25-GraphBascis/Graph.dart
index 4931128..66882d5 100644
--- a/25-GraphBascis/Graph.dart
+++ b/25-GraphBascis/Graph.dart
@@ -12,7 +12,7 @@ class Graph{
     if (E < 0) throw Exception("E must be non-negative");
     _treeSet = List.generate(V, (_) => SplayTreeSet<int>(), growable: false);
 
-    for (int i = 1; i < E; i++) {
+    for (int i = 1; i <= E; i++) {
       int a = int.parse(list[i].split(" ")[0]);
       _validateVertex(a);
       int b = int.parse(list[i].split(" ")[1]);
diff --git a/25-GraphBascis/g.txt b/25-GraphBascis/g.txt
index 1707a93..8500b5a 100644
--- a/25-GraphBascis/g.txt
+++ b/25-GraphBascis/g.txt
@@ -1,10 +1,7 @@
-7 9
+7 6
 0 1
-0 3
-1 2
-1 6
+0 2
+1 3
+1 4
 2 3
-2 5
-3 4
-4 5
-5 6
\ No newline at end of file
+2 6
\ No newline at end of file
diff --git a/26-GraphDFS/AdjMatrix.dart b/26-GraphDFS/AdjMatrix.dart
new file mode 100644
index 0000000..25b66ad
--- /dev/null
+++ b/26-GraphDFS/AdjMatrix.dart
@@ -0,0 +1,90 @@
+import 'dart:io';
+
+/**
+ * 图的邻接矩阵表示方式
+ *
+ * 注：
+ * 先读取文件，将相应数据赋值
+ */
+class AdjMatrix {
+  int? _V;//图的顶点数量
+  int? _E;//图的边的数量
+  List?  _adj;//邻接矩阵
+
+
+  AdjMatrix( V,E,List list) {
+    _V = V;
+    _E = E ;
+    if(V < 0) throw Exception("V must be non-negative");
+    if(E < 0) throw Exception("E must be non-negative");
+    _adj = List.generate(V, (_)=>List.generate(V,(_)=> 0),growable: false);
+    for(int i =1;i<=E;i++){
+      int a =  int.parse(list[i].split(" ")[0]);
+      _validateVertex(a);
+      int b = int.parse(list[i].split(" ")[1]);
+      _validateVertex(b);
+      _adj![a][b] = 1;
+      _adj![b][a] = 1;
+    }
+  }
+
+  _validateVertex(int v){
+    if(v < 0 || v >= _V!)
+      throw new Exception("vertex  $v is invalid");
+  }
+
+  int? V(){
+    return _V;
+  }
+
+  bool hasEdge(int v, int w){
+    _validateVertex(v);
+    _validateVertex(w);
+    return _adj![v][w] == 1;
+  }
+
+  int _degree(int v){
+    return _adj![v].length;
+  }
+
+  int? E(){
+    return _E;
+  }
+
+  List<int> adj(int v){
+    _validateVertex(v);
+    List<int> res = List.filled(_V!, 0,growable: true);
+    for(int i = 0; i < _V!; i ++)
+      if(_adj![v][i] == 1)
+        res.add(i);
+    return res;
+  }
+
+  @override
+  String toString() {
+    StringBuffer sb = new StringBuffer();
+    sb.write("V = $_V, E = $_E\n");
+    for (int i = 0; i < _V!; i ++) {
+      for (int j = 0; j < _V!; j ++)
+        sb.write("${_adj![i][j]} ");
+      sb.write('\n');
+    }
+    return sb.toString();
+  }
+
+
+}
+
+void main() async {
+  File content = File("g.txt");
+  List<String> list = await content.readAsLines();
+  //读取到文件的顶点数量以及
+  print(list[0].split(" ")[0]);
+  print(list[0].split(" ")[1]);
+  int v = int.parse(list[0].split(" ")[0]) ;
+  int e = int.parse(list[0].split(" ")[1]) ;
+//
+  AdjMatrix adjMatrix = AdjMatrix(v, e, list);
+  print(adjMatrix);
+
+}
\ No newline at end of file
diff --git a/26-GraphDFS/AdjMatrixDFS.dart b/26-GraphDFS/AdjMatrixDFS.dart
new file mode 100644
index 0000000..a39877a
--- /dev/null
+++ b/26-GraphDFS/AdjMatrixDFS.dart
@@ -0,0 +1,61 @@
+import 'AdjMatrix.dart';
+import 'dart:io';
+
+/**
+ * 邻接矩阵的深度遍历
+ */
+class AdjMatrixDFS {
+  AdjMatrix? G;
+
+  List? visited;
+
+  List? preList;
+
+  List? postList;
+
+  AdjMatrixDFS(AdjMatrix G) {
+    this.G = G;
+    visited = List.filled(G.V()!, false, growable: true);
+    preList = List.filled(0, 0, growable: true);
+    postList = List.filled(0, 0, growable: true);
+    for (int v = 0; v < G.V()!; v++) {
+      if (!(visited![v])) {
+        _dfs(v);
+      }
+    }
+  }
+
+  _dfs(int v) {
+    visited![v] = true;
+    preList!.add(v);
+    for (int w in G!.adj(v)) {
+      if (!visited![w]) {
+        _dfs(w);
+      }
+    }
+    postList!.add(v);
+  }
+
+  pre() {
+    return preList;
+  }
+
+  post() {
+    return postList;
+  }
+}
+
+void main() async {
+  File content = File("g.txt");
+  List<String> list = await content.readAsLines();
+  //读取到文件的顶点数量以及
+  print(list[0].split(" ")[0]);
+  print(list[0].split(" ")[1]);
+  int v = int.parse(list[0].split(" ")[0]);
+  int e = int.parse(list[0].split(" ")[1]);
+//
+  AdjMatrix adjList = AdjMatrix(v, e, list);
+  AdjMatrixDFS graphDFS = new AdjMatrixDFS(adjList);
+  print("DFS preOrder :  ${graphDFS.pre()}");
+  print("DFS postOrder : ${graphDFS.post()}");
+}
diff --git a/26-GraphDFS/ArrayStack.dart b/26-GraphDFS/ArrayStack.dart
new file mode 100644
index 0000000..f219345
--- /dev/null
+++ b/26-GraphDFS/ArrayStack.dart
@@ -0,0 +1,46 @@
+import 'Stack.dart';
+class ArrayStack<T> implements Stack<T>{
+
+  List? arr;
+  ArrayStack(){
+    arr =<dynamic>[];
+  }
+
+  @override
+  int getSize() {
+    return arr!.length;
+  }
+
+  @override
+  bool isEmpty() {
+    return arr!.isEmpty;
+  }
+
+  @override
+  T peek() {
+    return arr![0];
+  }
+
+  @override
+  T pop() => arr!.removeLast();
+
+  @override
+  void push(T e) {
+    arr!.add(e);
+  }
+
+  @override
+  String toString() {
+    StringBuffer buffer = new StringBuffer();
+    buffer.write("Stack: ");
+    buffer.write('[');
+    for(int i = 0 ; i < arr!.length ; i ++){
+      buffer.write(arr![i]);
+      if(i != arr!.length - 1)
+        buffer.write(", ");
+    }
+    buffer.write("] top");
+    return buffer.toString();
+  }
+
+}
\ No newline at end of file
diff --git a/26-GraphDFS/Graph.dart b/26-GraphDFS/Graph.dart
new file mode 100644
index 0000000..16bc1d5
--- /dev/null
+++ b/26-GraphDFS/Graph.dart
@@ -0,0 +1,80 @@
+import 'dart:collection';
+import 'dart:io';
+
+/**
+ * 图
+ */
+class Graph{
+  int? _V; //图的顶点数量
+  int? _E; //图的边的数量
+  List? _treeSet;
+
+  Graph(V, E, List list) {
+    _V = V;
+    _E = E;
+    if (V < 0) throw Exception("V must be non-negative");
+    if (E < 0) throw Exception("E must be non-negative");
+    _treeSet = List.generate(V, (_) => SplayTreeSet<int>(), growable: false);
+
+    for (int i = 1; i <= E; i++) {
+      int a = int.parse(list[i].split(" ")[0]);
+      _validateVertex(a);
+      int b = int.parse(list[i].split(" ")[1]);
+      _validateVertex(b);
+      (_treeSet![a] as SplayTreeSet).add(b);
+      (_treeSet![b] as SplayTreeSet).add(a);
+    }
+  }
+
+  _validateVertex(int v) {
+    if (v < 0 || v >= _V!) throw new Exception("vertex  $v is invalid");
+  }
+
+  int? V() {
+    return _V;
+  }
+
+  bool hasEdge(int v, int w) {
+    _validateVertex(v);
+    _validateVertex(w);
+    return (_treeSet![v] as SplayTreeSet).contains(w);
+  }
+
+  int _degree(int v) {
+    return _treeSet![v].length;
+  }
+
+  int? E() {
+    return _E;
+  }
+
+  adj(int v) {
+    _validateVertex(v);
+    return _treeSet![v];
+  }
+
+  @override
+  String toString() {
+    StringBuffer sb = new StringBuffer();
+    sb.write("V = $_V, E = $_E\n");
+    for (int j = 0; j < _V!; j++) {
+      sb.write("节点：$j ");
+      sb.write("${_treeSet![j].toString()} ");
+    sb.write('\n');
+    }
+    return sb.toString();
+  }
+}
+void main() async {
+  File content = File("g.txt");
+  List<String> list = await content.readAsLines();
+  //读取到文件的顶点数量以及
+  print(list[0].split(" ")[0]);
+  print(list[0].split(" ")[1]);
+  int v = int.parse(list[0].split(" ")[0]) ;
+  int e = int.parse(list[0].split(" ")[1]) ;
+//
+  Graph adjList= Graph(v, e, list);
+  print(adjList);
+
+}
diff --git a/26-GraphDFS/GraphDFS.dart b/26-GraphDFS/GraphDFS.dart
new file mode 100644
index 0000000..60a4b4e
--- /dev/null
+++ b/26-GraphDFS/GraphDFS.dart
@@ -0,0 +1,61 @@
+import 'Graph.dart';
+import 'dart:io';
+
+/**
+ * 图的深度遍历
+ */
+class GraphDFS {
+  Graph? G;
+
+  List? visited;
+
+  List? preList;
+
+  List? postList;
+
+  GraphDFS(Graph G) {
+    this.G = G;
+    visited = List.filled(G.V()!, false, growable: true);
+    preList = List.filled(0, 0, growable: true);
+    postList = List.filled(0, 0, growable: true);
+    for (int v = 0; v < G.V()!; v++) {
+      if (!(visited![v])) {
+        _dfs(v);
+      }
+    }
+  }
+
+  _dfs(int v) {
+    visited![v] = true;
+    preList!.add(v);
+    for (int w in G!.adj(v)) {
+      if (!visited![w]) {
+        _dfs(w);
+      }
+    }
+    postList!.add(v);
+  }
+
+  pre() {
+    return preList;
+  }
+
+   post() {
+    return postList;
+  }
+}
+
+void main() async {
+  File content = File("g.txt");
+  List<String> list = await content.readAsLines();
+  //读取到文件的顶点数量以及
+  print(list[0].split(" ")[0]);
+  print(list[0].split(" ")[1]);
+  int v = int.parse(list[0].split(" ")[0]);
+  int e = int.parse(list[0].split(" ")[1]);
+//
+  Graph adjList = Graph(v, e, list);
+  GraphDFS graphDFS = new GraphDFS(adjList);
+  print("DFS preOrder :  ${graphDFS.pre()}" );
+  print("DFS postOrder : ${graphDFS.post()}");
+}
diff --git a/26-GraphDFS/GraphDFSnr.dart b/26-GraphDFS/GraphDFSnr.dart
new file mode 100644
index 0000000..8fae5ef
--- /dev/null
+++ b/26-GraphDFS/GraphDFSnr.dart
@@ -0,0 +1,56 @@
+import 'Graph.dart';
+import 'dart:io';
+import 'Stack.dart';
+import 'ArrayStack.dart';
+
+class GraphDFSnr {
+  Graph? G;
+
+  List? visited;
+
+  List? preList;
+
+  GraphDFSnr(Graph G) {
+    this.G = G;
+    visited = List.filled(G.V()!, false, growable: true);
+    preList = List.filled(0, 0, growable: true);
+    for (int v = 0; v < G.V()!; v++) {
+      if (!(visited![v])) {
+        _dfs(v);
+      }
+    }
+  }
+
+  _dfs(int v) {
+    ArrayStack stack = ArrayStack();
+    stack.push(v);
+    visited![v] = true;
+    while (!stack.isEmpty()) {
+      int cur = stack.pop();
+      preList!.add(cur);
+      for (int w in G!.adj(cur))
+        if (!visited![w]) {
+          stack.push(w);
+          visited![w] = true;
+        }
+    }
+  }
+
+  pre() {
+    return preList;
+  }
+}
+
+void main() async {
+  File content = File("g.txt");
+  List<String> list = await content.readAsLines();
+  //读取到文件的顶点数量以及
+  print(list[0].split(" ")[0]);
+  print(list[0].split(" ")[1]);
+  int v = int.parse(list[0].split(" ")[0]);
+  int e = int.parse(list[0].split(" ")[1]);
+//
+  Graph adjList = Graph(v, e, list);
+  GraphDFSnr graphDFS = new GraphDFSnr(adjList);
+  print("DFS preOrder :  ${graphDFS.pre()}");
+}
diff --git a/26-GraphDFS/Stack.dart b/26-GraphDFS/Stack.dart
new file mode 100644
index 0000000..1af8f57
--- /dev/null
+++ b/26-GraphDFS/Stack.dart
@@ -0,0 +1,7 @@
+abstract class Stack<T>{
+  int getSize();
+  bool isEmpty();
+  void push(T e);
+  T pop();
+  T peek();
+}
\ No newline at end of file
diff --git a/26-GraphDFS/g.txt b/26-GraphDFS/g.txt
new file mode 100644
index 0000000..8500b5a
--- /dev/null
+++ b/26-GraphDFS/g.txt
@@ -0,0 +1,7 @@
+7 6
+0 1
+0 2
+1 3
+1 4
+2 3
+2 6
\ No newline at end of file
diff --git a/27-GraphDFS-Application/BipartitionDetection.dart b/27-GraphDFS-Application/BipartitionDetection.dart
new file mode 100644
index 0000000..22fc2d8
--- /dev/null
+++ b/27-GraphDFS-Application/BipartitionDetection.dart
@@ -0,0 +1,79 @@
+import 'Graph.dart';
+import 'dart:io';
+/**
+ * 二分图检测
+ */
+class BipartitionDetection {
+  Graph? _G;
+
+  List? _visited;
+
+  List? _colors;
+
+  bool _isBipartite = true;
+
+  BipartitionDetection(Graph G) {
+    this._G = G;
+    _visited = List.filled(_G!.V()!, false, growable: true);
+    _colors = List.filled(_G!.V()!, 0, growable: true);
+    for (int i = 0; i < _G!.V()!; i++) _colors![i] = -1;
+
+    for (int v = 0; v < _G!.V()!; v++)
+      if (!_visited![v]) if (!_dfs(v, 0)) {
+        _isBipartite = false;
+        break;
+      }
+  }
+
+  bool _dfs(int v, int color) {
+    _visited![v] = true;
+    _colors![v] = color;
+    for (int w in _G!.adj(v))
+      if (!_visited![w]) {
+        if (!_dfs(w, 1 - color)) return false;
+      } else if (_colors![w] == _colors![v]) return false;
+    return true;
+  }
+
+  bool isBipartite() {
+    return _isBipartite;
+  }
+}
+void main()async{
+  print("------------------txt1");
+  File content = File("g.txt");
+  List<String> list = await content.readAsLines();
+  //读取到文件的顶点数量以及
+  int v = int.parse(list[0].split(" ")[0]);
+  int e = int.parse(list[0].split(" ")[1]);
+//
+  Graph graph = Graph(v, e, list);
+
+  BipartitionDetection bipartitionDetection = BipartitionDetection(graph);
+  print(bipartitionDetection.isBipartite());
+print("------------------txt2");
+  File content2 = File("g2.txt");
+  List<String> list2 = await content2.readAsLines();
+  //读取到文件的顶点数量以及
+  int v2 = int.parse(list2[0].split(" ")[0]);
+  int e2 = int.parse(list2[0].split(" ")[1]);
+//
+  Graph graph2 = Graph(v2, e2, list2);
+
+  BipartitionDetection bipartitionDetection2 = BipartitionDetection(graph2);
+  print(bipartitionDetection2.isBipartite());
+  print("------------------txt3");
+
+  File content3 = File("g3.txt");
+  List<String> list3 = await content3.readAsLines();
+  //读取到文件的顶点数量以及
+  int v3 = int.parse(list3[0].split(" ")[0]);
+  int e3 = int.parse(list3[0].split(" ")[1]);
+//
+  Graph graph3 = Graph(v3, e3, list3);
+
+  BipartitionDetection bipartitionDetection3 = BipartitionDetection(graph3);
+  print(bipartitionDetection3.isBipartite());
+
+
+}
diff --git a/27-GraphDFS-Application/CC.dart b/27-GraphDFS-Application/CC.dart
new file mode 100644
index 0000000..33aa495
--- /dev/null
+++ b/27-GraphDFS-Application/CC.dart
@@ -0,0 +1,80 @@
+import 'Graph.dart';
+import 'dart:io';
+
+/**
+ * 图的联通分量
+ */
+class CC{
+  Graph? G;
+
+  List? _visited;
+  int _cccount = 0;
+
+  CC(Graph G) {
+    this.G = G;
+    _visited = List.filled(G.V()!, 0, growable: true);
+
+    for(int i = 0; i < _visited!.length; i ++)
+      _visited![i] = -1;
+
+    for (int v = 0; v < G.V()!; v++) {
+      if (_visited![v] == -1) {
+        _dfs(v,_cccount);
+        _cccount ++;
+      }
+    }
+  }
+
+  _dfs(int v, int ccid) {
+    _visited![v] = ccid;
+    for (int w in G!.adj(v)) {
+      if (_visited![w] == -1) {
+        _dfs(w,ccid);
+      }
+    }
+  }
+
+  int count(){
+    return _cccount;
+  }
+
+  bool isConnected(int v, int w){
+    G!.validateVertex(v);
+    G!.validateVertex(w);
+    return _visited![v] == _visited![w];
+  }
+
+  components(){
+    List? res =List.generate(_cccount, (_)=>List.generate(0,(_)=> 0),growable: true);
+    for(int v = 0; v < G!.V()!; v ++)
+      res[_visited![v]].add(v);
+    return res;
+  }
+}
+
+void main() async {
+  File content = File("g.txt");
+  List<String> list = await content.readAsLines();
+  //读取到文件的顶点数量以及
+  int v = int.parse(list[0].split(" ")[0]) ;
+  int e = int.parse(list[0].split(" ")[1]) ;
+//
+  Graph adjList= Graph(v, e, list);
+  CC cc = new CC(adjList);
+  print(cc.count());
+
+  print(cc.isConnected(0, 6));
+  print(cc.isConnected(5, 6));
+
+  List comp = cc.components();
+  for(int ccid = 0; ccid < comp.length; ccid ++){
+    print("$ccid  :: ");
+    for(int w in  comp[ccid]) {
+      print("$w ");
+    }
+    print("");
+  }
+
+  print(adjList);
+
+}
\ No newline at end of file
diff --git a/27-GraphDFS-Application/CycleDetection.dart b/27-GraphDFS-Application/CycleDetection.dart
new file mode 100644
index 0000000..c3f2e4b
--- /dev/null
+++ b/27-GraphDFS-Application/CycleDetection.dart
@@ -0,0 +1,65 @@
+import 'Graph.dart';
+import 'dart:io';
+/**
+ * 无向图的环检测
+ */
+class CycleDetection {
+  Graph? _G;
+
+  List? _visited;
+
+  bool _hasCycle = false;
+
+  CycleDetection(Graph G) {
+    this._G = G;
+    _visited = List.filled(_G!.V()!, false, growable: true);
+    for (int v = 0; v < _G!.V()!; v++)
+      if (!_visited![v]) if (_dfs(v, v)) {
+        _hasCycle = true;
+        break;
+      }
+  }
+
+  // 从顶点 v 开始，判断图中是否有环
+  bool _dfs(int v, int parent) {
+    _visited![v] = true;
+    for (int w in _G!.adj(v))
+      if (!_visited![w]) {
+        if (_dfs(w, v)) return true;
+      } else if (w != parent) return true;
+    return false;
+  }
+
+  bool hasCycle() {
+    return _hasCycle;
+  }
+}
+
+void main () async{
+
+  File content = File("g.txt");
+  List<String> list = await content.readAsLines();
+  //读取到文件的顶点数量以及
+  int v = int.parse(list[0].split(" ")[0]);
+  int e = int.parse(list[0].split(" ")[1]);
+//
+  Graph graph = Graph(v, e, list);
+
+  CycleDetection cycleDetection = CycleDetection(graph);
+  print(cycleDetection.hasCycle());
+
+  File content2 = File("g2.txt");
+  List<String> list2 = await content2.readAsLines();
+  //读取到文件的顶点数量以及
+  int v2 = int.parse(list2[0].split(" ")[0]);
+  int e2 = int.parse(list2[0].split(" ")[1]);
+//
+  Graph graph2 = Graph(v2, e2, list2);
+
+  CycleDetection cycleDetection2 = CycleDetection(graph2);
+  print(cycleDetection2.hasCycle());
+
+
+}
+
+
diff --git a/27-GraphDFS-Application/Graph.dart b/27-GraphDFS-Application/Graph.dart
new file mode 100644
index 0000000..0d44faa
--- /dev/null
+++ b/27-GraphDFS-Application/Graph.dart
@@ -0,0 +1,80 @@
+import 'dart:collection';
+import 'dart:io';
+
+/**
+ * 图
+ */
+class Graph{
+  int? _V; //图的顶点数量
+  int? _E; //图的边的数量
+  List? _treeSet;
+
+  Graph(V, E, List list) {
+    _V = V;
+    _E = E;
+    if (V < 0) throw Exception("V must be non-negative");
+    if (E < 0) throw Exception("E must be non-negative");
+    _treeSet = List.generate(V, (_) => SplayTreeSet<int>(), growable: false);
+
+    for (int i = 1; i <= E; i++) {
+      int a = int.parse(list[i].split(" ")[0]);
+      validateVertex(a);
+      int b = int.parse(list[i].split(" ")[1]);
+      validateVertex(b);
+      (_treeSet![a] as SplayTreeSet).add(b);
+      (_treeSet![b] as SplayTreeSet).add(a);
+    }
+  }
+
+  validateVertex(int v) {
+    if (v < 0 || v >= _V!) throw new Exception("vertex  $v is invalid");
+  }
+
+  int? V() {
+    return _V;
+  }
+
+  bool hasEdge(int v, int w) {
+    validateVertex(v);
+    validateVertex(w);
+    return (_treeSet![v] as SplayTreeSet).contains(w);
+  }
+
+  int _degree(int v) {
+    return _treeSet![v].length;
+  }
+
+  int? E() {
+    return _E;
+  }
+
+  adj(int v) {
+    validateVertex(v);
+    return _treeSet![v];
+  }
+
+  @override
+  String toString() {
+    StringBuffer sb = new StringBuffer();
+    sb.write("V = $_V, E = $_E\n");
+    for (int j = 0; j < _V!; j++) {
+      sb.write("节点：$j ");
+      sb.write("${_treeSet![j].toString()} ");
+    sb.write('\n');
+    }
+    return sb.toString();
+  }
+}
+void main() async {
+  File content = File("g.txt");
+  List<String> list = await content.readAsLines();
+  //读取到文件的顶点数量以及
+  print(list[0].split(" ")[0]);
+  print(list[0].split(" ")[1]);
+  int v = int.parse(list[0].split(" ")[0]) ;
+  int e = int.parse(list[0].split(" ")[1]) ;
+//
+  Graph adjList= Graph(v, e, list);
+  print(adjList);
+
+}
diff --git a/27-GraphDFS-Application/GraphDFS.dart b/27-GraphDFS-Application/GraphDFS.dart
new file mode 100644
index 0000000..2142237
--- /dev/null
+++ b/27-GraphDFS-Application/GraphDFS.dart
@@ -0,0 +1,59 @@
+import 'Graph.dart';
+import 'dart:io';
+
+/**
+ * 图的深度遍历
+ */
+class GraphDFS {
+  Graph? G;
+
+  List? _visited;
+
+  List? _preList;
+
+  List? _postList;
+
+  GraphDFS(Graph G) {
+    this.G = G;
+    _visited = List.filled(G.V()!, false, growable: true);
+    _preList = List.filled(0, 0, growable: true);
+    _postList = List.filled(0, 0, growable: true);
+    for (int v = 0; v < G.V()!; v++) {
+      if (!(_visited![v])) {
+        _dfs(v);
+      }
+    }
+  }
+
+  _dfs(int v) {
+    _visited![v] = true;
+    _preList!.add(v);
+    for (int w in G!.adj(v)) {
+      if (!_visited![w]) {
+        _dfs(w);
+      }
+    }
+    _postList!.add(v);
+  }
+
+  pre() {
+    return _preList;
+  }
+
+   post() {
+    return _postList;
+  }
+}
+
+void main() async {
+  File content = File("g.txt");
+  List<String> list = await content.readAsLines();
+  //读取到文件的顶点数量以及
+  int v = int.parse(list[0].split(" ")[0]);
+  int e = int.parse(list[0].split(" ")[1]);
+//
+  Graph adjList = Graph(v, e, list);
+  GraphDFS graphDFS = new GraphDFS(adjList);
+  print("DFS preOrder :  ${graphDFS.pre()}" );
+  print("DFS postOrder : ${graphDFS.post()}");
+}
diff --git a/27-GraphDFS-Application/SingleSourcePath.dart b/27-GraphDFS-Application/SingleSourcePath.dart
new file mode 100644
index 0000000..233ac86
--- /dev/null
+++ b/27-GraphDFS-Application/SingleSourcePath.dart
@@ -0,0 +1,65 @@
+import 'Graph.dart';
+import 'dart:io';
+/**
+ * 单源路径问题
+ *
+ */
+class SingleSourcePath {
+  Graph? _G;
+
+  int? _s;
+
+  List? pre;
+
+  SingleSourcePath(Graph G, int s) {
+    this._G = G;
+    this._s = s;
+    pre = List.filled(_G!.V()!, 0, growable: true);
+    for (int i = 0; i < pre!.length; i++) {
+      pre![i] = -1;
+    }
+    _dfs(s, s);
+  }
+
+  _dfs(int v, int parent) {
+    pre![v] = parent;
+    for (int w in _G!.adj(v)) {
+      if (pre![w] == -1) {
+        _dfs(w, v);
+      }
+    }
+  }
+
+  bool isConnectedTo(int t) {
+    _G!.validateVertex(t);
+    return pre![t] != -1;
+  }
+
+  path(int t) {
+    List res = List.filled(0, 0, growable: true);
+    if (!isConnectedTo(t)) return res;
+
+    int cur = t;
+    while (cur != _s) {
+      res.add(cur);
+      cur = pre![cur];
+    }
+    res.add(_s);
+    var result  = res.reversed;
+    return result;
+  }
+}
+
+void main() async {
+  File content = File("g.txt");
+  List<String> list = await content.readAsLines();
+  //读取到文件的顶点数量以及
+  int v = int.parse(list[0].split(" ")[0]) ;
+  int e = int.parse(list[0].split(" ")[1]) ;
+//
+  Graph graph= Graph(v, e, list);
+  SingleSourcePath sspath = new SingleSourcePath(graph, 0);
+
+  print("0 -> 6 : ${sspath.path(6)}");
+  print("0 -> 5 : ${sspath.path(5)}");
+}
diff --git a/27-GraphDFS-Application/g.txt b/27-GraphDFS-Application/g.txt
new file mode 100644
index 0000000..8500b5a
--- /dev/null
+++ b/27-GraphDFS-Application/g.txt
@@ -0,0 +1,7 @@
+7 6
+0 1
+0 2
+1 3
+1 4
+2 3
+2 6
\ No newline at end of file
diff --git a/27-GraphDFS-Application/g2.txt b/27-GraphDFS-Application/g2.txt
new file mode 100644
index 0000000..6a3b456
--- /dev/null
+++ b/27-GraphDFS-Application/g2.txt
@@ -0,0 +1,6 @@
+7 5
+0 1
+0 2
+1 3
+1 4
+2 6
diff --git a/27-GraphDFS-Application/g3.txt b/27-GraphDFS-Application/g3.txt
new file mode 100644
index 0000000..a50c8b8
--- /dev/null
+++ b/27-GraphDFS-Application/g3.txt
@@ -0,0 +1,5 @@
+4 4
+0 1
+0 3
+1 2
+2 3
\ No newline at end of file
diff --git a/28-Graph-BFS/BipartitionDetection.dart b/28-Graph-BFS/BipartitionDetection.dart
new file mode 100644
index 0000000..da8acb3
--- /dev/null
+++ b/28-Graph-BFS/BipartitionDetection.dart
@@ -0,0 +1,88 @@
+import 'Graph.dart';
+import 'dart:io';
+import 'dart:collection';
+
+/**
+ * 二分图检测BFS方法
+ */
+class BipartitionDetection {
+  Graph? _G;
+
+  List? _visited;
+
+  List? _colors;
+
+  bool _isBipartite = true;
+
+  BipartitionDetection(Graph G) {
+    this._G = G;
+    _visited = List.filled(_G!.V()!, false, growable: true);
+    _colors = List.filled(_G!.V()!, 0, growable: true);
+    for (int i = 0; i < _G!.V()!; i++) _colors![i] = -1;
+
+    for (int v = 0; v < _G!.V()!; v++)
+      if (!_visited![v]) if (!_bfs(v, 0)) {
+        _isBipartite = false;
+        break;
+      }
+  }
+
+  bool _bfs(int v, int color) {
+    ListQueue queue = ListQueue();
+    queue.add(v);
+    _visited![v] = true;
+    _colors![v] = 0;
+    while (!queue.isEmpty) {
+      int v = queue.removeFirst();
+
+      for (int w in _G!.adj(v))
+        if (!_visited![w]) {
+          queue.add(w);
+          _visited![w] = true;
+          _colors![w] = 1 - _colors![v];
+        } else if (_colors![v] == _colors![w]) return false;
+    }
+    return true;
+  }
+
+  bool isBipartite() {
+    return _isBipartite;
+  }
+}
+
+void main() async {
+  print("------------------txt1");
+  File content = File("g.txt");
+  List<String> list = await content.readAsLines();
+  //读取到文件的顶点数量以及
+  int v = int.parse(list[0].split(" ")[0]);
+  int e = int.parse(list[0].split(" ")[1]);
+//
+  Graph graph = Graph(v, e, list);
+
+  BipartitionDetection bipartitionDetection = BipartitionDetection(graph);
+  print(bipartitionDetection.isBipartite());
+  print("------------------txt2");
+  File content2 = File("g2.txt");
+  List<String> list2 = await content2.readAsLines();
+  //读取到文件的顶点数量以及
+  int v2 = int.parse(list2[0].split(" ")[0]);
+  int e2 = int.parse(list2[0].split(" ")[1]);
+//
+  Graph graph2 = Graph(v2, e2, list2);
+
+  BipartitionDetection bipartitionDetection2 = BipartitionDetection(graph2);
+  print(bipartitionDetection2.isBipartite());
+  print("------------------txt3");
+
+  File content3 = File("g3.txt");
+  List<String> list3 = await content3.readAsLines();
+  //读取到文件的顶点数量以及
+  int v3 = int.parse(list3[0].split(" ")[0]);
+  int e3 = int.parse(list3[0].split(" ")[1]);
+//
+  Graph graph3 = Graph(v3, e3, list3);
+
+  BipartitionDetection bipartitionDetection3 = BipartitionDetection(graph3);
+  print(bipartitionDetection3.isBipartite());
+}
diff --git a/28-Graph-BFS/CC.dart b/28-Graph-BFS/CC.dart
new file mode 100644
index 0000000..21a6891
--- /dev/null
+++ b/28-Graph-BFS/CC.dart
@@ -0,0 +1,85 @@
+import 'Graph.dart';
+import 'dart:io';
+import 'dart:collection';
+
+/**
+ * 图的联通分量BFS
+ */
+class CC {
+  Graph? _G;
+
+  List? _visited;
+
+  int _cccount = 0;
+
+  CC(Graph G) {
+    this._G = G;
+    _visited = List.filled(G.V()!, 0, growable: true);
+
+    for (int i = 0; i < _visited!.length; i++) _visited![i] = -1;
+
+    for (int v = 0; v < G.V()!; v++) {
+      if (_visited![v] == -1) {
+        _bfs(v, _cccount);
+        _cccount++;
+      }
+    }
+  }
+
+  _bfs(int v, int ccid) {
+    ListQueue queue = ListQueue();
+    queue.add(v);
+    _visited![v] = ccid;
+    while (!queue.isEmpty) {
+      int v = queue.removeFirst();
+
+      for (int w in _G!.adj(v)) {
+        if (_visited![w] == -1) {
+          queue.add(w);
+          _visited![w] = ccid;
+        }
+      }
+    }
+  }
+
+  int count() {
+    return _cccount;
+  }
+
+  bool isConnected(int v, int w) {
+    _G!.validateVertex(v);
+    _G!.validateVertex(w);
+    return _visited![v] == _visited![w];
+  }
+
+  components() {
+    List? res = List.generate(_cccount, (_) => List.generate(0, (_) => 0),
+        growable: true);
+    for (int v = 0; v < _G!.V()!; v++) res[_visited![v]].add(v);
+    return res;
+  }
+}
+
+void main() async {
+  File content = File("g.txt");
+  List<String> list = await content.readAsLines();
+  //读取到文件的顶点数量以及
+  int v = int.parse(list[0].split(" ")[0]);
+  int e = int.parse(list[0].split(" ")[1]);
+//
+  Graph adjList = Graph(v, e, list);
+  CC cc = new CC(adjList);
+  print(cc.count());
+
+  print(cc.isConnected(0, 6));
+  print(cc.isConnected(5, 6));
+
+  List comp = cc.components();
+  for (int ccid = 0; ccid < comp.length; ccid++) {
+    print("$ccid  :: ");
+    for (int w in comp[ccid]) {
+      print("$w ");
+    }
+    print("");
+  }
+}
diff --git a/28-Graph-BFS/CycleDetection.dart b/28-Graph-BFS/CycleDetection.dart
new file mode 100644
index 0000000..dcd46c0
--- /dev/null
+++ b/28-Graph-BFS/CycleDetection.dart
@@ -0,0 +1,81 @@
+import 'Graph.dart';
+import 'dart:io';
+import 'dart:collection';
+
+/**
+ * 无向图的环检测BFS问题
+ */
+class CycleDetection {
+  Graph? _G;
+
+  List? _visited;
+
+  bool _hasCycle = false;
+
+  List? _pre;
+
+  CycleDetection(Graph G) {
+    this._G = G;
+    _visited = List.filled(_G!.V()!, false, growable: true);
+    _pre = List.filled(_G!.V()!, 0, growable: true);
+    for (int i = 0; i < _G!.V()!; i++) {
+      _pre![i] = -1;
+    }
+    for (int v = 0; v < _G!.V()!; v++) {
+      if (!_visited![v]) {
+        if (_bfs(v, v)) {
+          _hasCycle = true;
+          break;
+        }
+      }
+    }
+  }
+
+  // 从顶点 v 开始，判断图中是否有环
+  bool _bfs(int v, int parent) {
+    ListQueue queue = ListQueue();
+    queue.add(v);
+    _visited![v] = true;
+    _pre![v] = v;
+    while (!queue.isEmpty) {
+      int v = queue.removeFirst();
+
+      for (int w in _G!.adj(v))
+        if (!_visited![w]) {
+          queue.add(w);
+          _visited![w] = true;
+          _pre![w] = v;
+        } else if (_pre![v] != w) return true;
+    }
+
+    return false;
+  }
+
+  bool hasCycle() {
+    return _hasCycle;
+  }
+}
+
+void main() async {
+  File content = File("g.txt");
+  List<String> list = await content.readAsLines();
+  //读取到文件的顶点数量以及
+  int v = int.parse(list[0].split(" ")[0]);
+  int e = int.parse(list[0].split(" ")[1]);
+//
+  Graph graph = Graph(v, e, list);
+
+  CycleDetection cycleDetection = CycleDetection(graph);
+  print(cycleDetection.hasCycle());
+
+  File content2 = File("g2.txt");
+  List<String> list2 = await content2.readAsLines();
+  //读取到文件的顶点数量以及
+  int v2 = int.parse(list2[0].split(" ")[0]);
+  int e2 = int.parse(list2[0].split(" ")[1]);
+//
+  Graph graph2 = Graph(v2, e2, list2);
+
+  CycleDetection cycleDetection2 = CycleDetection(graph2);
+  print(cycleDetection2.hasCycle());
+}
diff --git a/28-Graph-BFS/Graph.dart b/28-Graph-BFS/Graph.dart
new file mode 100644
index 0000000..0d44faa
--- /dev/null
+++ b/28-Graph-BFS/Graph.dart
@@ -0,0 +1,80 @@
+import 'dart:collection';
+import 'dart:io';
+
+/**
+ * 图
+ */
+class Graph{
+  int? _V; //图的顶点数量
+  int? _E; //图的边的数量
+  List? _treeSet;
+
+  Graph(V, E, List list) {
+    _V = V;
+    _E = E;
+    if (V < 0) throw Exception("V must be non-negative");
+    if (E < 0) throw Exception("E must be non-negative");
+    _treeSet = List.generate(V, (_) => SplayTreeSet<int>(), growable: false);
+
+    for (int i = 1; i <= E; i++) {
+      int a = int.parse(list[i].split(" ")[0]);
+      validateVertex(a);
+      int b = int.parse(list[i].split(" ")[1]);
+      validateVertex(b);
+      (_treeSet![a] as SplayTreeSet).add(b);
+      (_treeSet![b] as SplayTreeSet).add(a);
+    }
+  }
+
+  validateVertex(int v) {
+    if (v < 0 || v >= _V!) throw new Exception("vertex  $v is invalid");
+  }
+
+  int? V() {
+    return _V;
+  }
+
+  bool hasEdge(int v, int w) {
+    validateVertex(v);
+    validateVertex(w);
+    return (_treeSet![v] as SplayTreeSet).contains(w);
+  }
+
+  int _degree(int v) {
+    return _treeSet![v].length;
+  }
+
+  int? E() {
+    return _E;
+  }
+
+  adj(int v) {
+    validateVertex(v);
+    return _treeSet![v];
+  }
+
+  @override
+  String toString() {
+    StringBuffer sb = new StringBuffer();
+    sb.write("V = $_V, E = $_E\n");
+    for (int j = 0; j < _V!; j++) {
+      sb.write("节点：$j ");
+      sb.write("${_treeSet![j].toString()} ");
+    sb.write('\n');
+    }
+    return sb.toString();
+  }
+}
+void main() async {
+  File content = File("g.txt");
+  List<String> list = await content.readAsLines();
+  //读取到文件的顶点数量以及
+  print(list[0].split(" ")[0]);
+  print(list[0].split(" ")[1]);
+  int v = int.parse(list[0].split(" ")[0]) ;
+  int e = int.parse(list[0].split(" ")[1]) ;
+//
+  Graph adjList= Graph(v, e, list);
+  print(adjList);
+
+}
diff --git a/28-Graph-BFS/GraphBFS.dart b/28-Graph-BFS/GraphBFS.dart
new file mode 100644
index 0000000..16adac3
--- /dev/null
+++ b/28-Graph-BFS/GraphBFS.dart
@@ -0,0 +1,56 @@
+import 'Graph.dart';
+import 'dart:collection';
+import 'dart:io';
+/**
+ * 图的广度优先遍历
+ */
+class GraphBFS {
+  Graph? G;
+
+  List? _visited;
+
+  List? _orderList = List.filled(0,0, growable: true);
+
+  GraphBFS(Graph G) {
+    this.G = G;
+    _visited = List.filled(G.V()!, false, growable: true);
+    for (int v = 0; v < G.V()!; v++) {
+      if (!(_visited![v])) {
+        _bfs(v);
+      }
+    }
+  }
+
+  _bfs(int v) {
+    ListQueue queue = ListQueue();
+    queue.add(v);
+    _visited![v] = true;
+    while (!queue.isEmpty) {
+      int v = queue.removeFirst();
+      _orderList!.add(v);
+      for (int w in G!.adj(v)) {
+        if (!_visited![w]) {
+          queue.add(w);
+          _visited![w] = true;
+        }
+      }
+    }
+  }
+
+  order() {
+    return _orderList;
+  }
+}
+void main() async {
+  File content = File("g.txt");
+  List<String> list = await content.readAsLines();
+  //读取到文件的顶点数量以及
+  print(list[0].split(" ")[0]);
+  print(list[0].split(" ")[1]);
+  int v = int.parse(list[0].split(" ")[0]);
+  int e = int.parse(list[0].split(" ")[1]);
+//
+  Graph adjList = Graph(v, e, list);
+  GraphBFS graphDFS = new GraphBFS(adjList);
+  print("BFS Order :  ${graphDFS.order()}" );
+}
\ No newline at end of file
diff --git a/28-Graph-BFS/SingleSourcePath.dart b/28-Graph-BFS/SingleSourcePath.dart
new file mode 100644
index 0000000..e22b2ef
--- /dev/null
+++ b/28-Graph-BFS/SingleSourcePath.dart
@@ -0,0 +1,77 @@
+import 'Graph.dart';
+import 'dart:io';
+import 'dart:collection';
+
+/**
+ * 单源路径BFS问题
+ *
+ */
+class SingleSourcePath {
+  Graph? _G;
+
+  int? _s;
+
+  List? pre;
+
+  List? _visited;
+
+  SingleSourcePath(Graph G, int s) {
+    this._G = G;
+    this._s = s;
+    pre = List.filled(_G!.V()!, 0, growable: true);
+    _visited = List.filled(G.V()!, false, growable: true);
+    for (int i = 0; i < pre!.length; i++) {
+      pre![i] = -1;
+    }
+    _bfs(s);
+  }
+
+  _bfs(int v) {
+    ListQueue queue = ListQueue();
+    queue.add(v);
+    _visited![v] = true;
+    pre![v] = v;
+    while (!queue.isEmpty) {
+      int v = queue.removeFirst();
+
+      for (int w in _G!.adj(v))
+        if (!_visited![w]) {
+          queue.add(w);
+          _visited![w] = true;
+          pre![w] = v;
+        }
+    }
+  }
+
+  bool isConnectedTo(int t) {
+    _G!.validateVertex(t);
+    return pre![t] != -1;
+  }
+
+  path(int t) {
+    List res = List.filled(0, 0, growable: true);
+    if (!isConnectedTo(t)) return res;
+
+    int cur = t;
+    while (cur != _s) {
+      res.add(cur);
+      cur = pre![cur];
+    }
+    res.add(_s);
+    var result = res.reversed;
+    return result;
+  }
+}
+
+void main() async {
+  File content = File("g.txt");
+  List<String> list = await content.readAsLines();
+  //读取到文件的顶点数量以及
+  int v = int.parse(list[0].split(" ")[0]);
+  int e = int.parse(list[0].split(" ")[1]);
+//
+  Graph graph = Graph(v, e, list);
+  SingleSourcePath sspath = new SingleSourcePath(graph, 0);
+
+  print("0 -> 6 : ${sspath.path(6)}");
+}
diff --git a/28-Graph-BFS/g.txt b/28-Graph-BFS/g.txt
new file mode 100644
index 0000000..8500b5a
--- /dev/null
+++ b/28-Graph-BFS/g.txt
@@ -0,0 +1,7 @@
+7 6
+0 1
+0 2
+1 3
+1 4
+2 3
+2 6
\ No newline at end of file
diff --git a/28-Graph-BFS/g2.txt b/28-Graph-BFS/g2.txt
new file mode 100644
index 0000000..6a3b456
--- /dev/null
+++ b/28-Graph-BFS/g2.txt
@@ -0,0 +1,6 @@
+7 5
+0 1
+0 2
+1 3
+1 4
+2 6
diff --git a/28-Graph-BFS/g3.txt b/28-Graph-BFS/g3.txt
new file mode 100644
index 0000000..a50c8b8
--- /dev/null
+++ b/28-Graph-BFS/g3.txt
@@ -0,0 +1,5 @@
+4 4
+0 1
+0 3
+1 2
+2 3
\ No newline at end of file
diff --git a/README.md b/README.md
index 7b7a0f3..bc6e86f 100644
--- a/README.md
+++ b/README.md
@@ -27,6 +27,17 @@
 23. MSD排序，桶排序
 24. 字符串匹配
 25. 图的邻接矩阵,邻接表
+26. 图的深度优先遍历
+27. 图的深度优先遍历应用
+    1. 图的联通分量
+    2. 图的单源路径问题
+    3. 无向图的环检测
+    4. 二分图检测
+28. 图的广度优先遍历
+    1. 图的单源路径问题
+    2. 图的联通分量
+    3. 无向图的环检测
+    4. 二分图检测
 
 #### 后续更新
 1. 将图相关的数据结构与算法用dart语言重新实现

From a72a4fb8090a6a29d655a48a7b1e6561fd6289b7 Mon Sep 17 00:00:00 2001
From: "tianqing.liang" <1>
Date: Wed, 22 Sep 2021 17:16:17 +0800
Subject: [PATCH 10/21] =?UTF-8?q?=E5=9B=BE=E7=9A=84=E6=B7=B1=E5=BA=A6?=
 =?UTF-8?q?=E4=BC=98=E5=85=88=E9=81=8D=E5=8E=86=EF=BC=8C=E5=B9=BF=E5=BA=A6?=
 =?UTF-8?q?=E4=BC=98=E5=85=88=E9=81=8D=E5=8E=86=EF=BC=8C=E4=BB=A5=E5=8F=8A?=
 =?UTF-8?q?=E7=9B=B8=E5=BA=94=E7=9A=84=E5=BA=94=E7=94=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 README.md | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/README.md b/README.md
index bc6e86f..153199c 100644
--- a/README.md
+++ b/README.md
@@ -39,9 +39,6 @@
     3. 无向图的环检测
     4. 二分图检测
 
-#### 后续更新
-1. 将图相关的数据结构与算法用dart语言重新实现
-
 #### SDK版本
 1. 版本：2.12.3
 2. Java版本课程地址：[慕课网算法与数据结构](https://class.imooc.com/sale/datastructure)

From 4a04d96dd99de6781047bfa284cbc0a66749f351 Mon Sep 17 00:00:00 2001
From: "tianqing.liang" <1>
Date: Thu, 23 Sep 2021 14:56:18 +0800
Subject: [PATCH 11/21] =?UTF-8?q?=E6=A1=A5=EF=BC=8C=E5=89=B2=E7=82=B9?=
 =?UTF-8?q?=EF=BC=8C=E6=9C=80=E5=B0=8F=E7=94=9F=E6=88=90=E6=A0=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 29-Brigde-And-Cut-Points/Edge.dart          |  12 +++
 29-Brigde-And-Cut-Points/FindBridges.dart   | 108 ++++++++++++++++++++
 29-Brigde-And-Cut-Points/FindCutPoints.dart |  96 +++++++++++++++++
 29-Brigde-And-Cut-Points/Graph.dart         |  80 +++++++++++++++
 29-Brigde-And-Cut-Points/g.txt              |   9 ++
 29-Brigde-And-Cut-Points/g2.txt             |  17 +++
 29-Brigde-And-Cut-Points/g3.txt             |   6 ++
 29-Brigde-And-Cut-Points/g4.txt             |   9 ++
 29-Brigde-And-Cut-Points/tree.txt           |   7 ++
 30-Minimum-Tree-Spanning/CC.dart            |  85 +++++++++++++++
 30-Minimum-Tree-Spanning/Edge.dart          |  12 +++
 30-Minimum-Tree-Spanning/Graph.dart         |  80 +++++++++++++++
 30-Minimum-Tree-Spanning/Kruskal.dart       |  50 +++++++++
 30-Minimum-Tree-Spanning/Prim.dart          |  62 +++++++++++
 30-Minimum-Tree-Spanning/UF.dart            |  32 ++++++
 30-Minimum-Tree-Spanning/WeightedEdge.dart  |  31 ++++++
 30-Minimum-Tree-Spanning/WeightedGraph.dart | 101 ++++++++++++++++++
 30-Minimum-Tree-Spanning/g.txt              |  13 +++
 README.md                                   |   2 +
 19 files changed, 812 insertions(+)
 create mode 100644 29-Brigde-And-Cut-Points/Edge.dart
 create mode 100644 29-Brigde-And-Cut-Points/FindBridges.dart
 create mode 100644 29-Brigde-And-Cut-Points/FindCutPoints.dart
 create mode 100644 29-Brigde-And-Cut-Points/Graph.dart
 create mode 100644 29-Brigde-And-Cut-Points/g.txt
 create mode 100644 29-Brigde-And-Cut-Points/g2.txt
 create mode 100644 29-Brigde-And-Cut-Points/g3.txt
 create mode 100644 29-Brigde-And-Cut-Points/g4.txt
 create mode 100644 29-Brigde-And-Cut-Points/tree.txt
 create mode 100644 30-Minimum-Tree-Spanning/CC.dart
 create mode 100644 30-Minimum-Tree-Spanning/Edge.dart
 create mode 100644 30-Minimum-Tree-Spanning/Graph.dart
 create mode 100644 30-Minimum-Tree-Spanning/Kruskal.dart
 create mode 100644 30-Minimum-Tree-Spanning/Prim.dart
 create mode 100644 30-Minimum-Tree-Spanning/UF.dart
 create mode 100644 30-Minimum-Tree-Spanning/WeightedEdge.dart
 create mode 100644 30-Minimum-Tree-Spanning/WeightedGraph.dart
 create mode 100644 30-Minimum-Tree-Spanning/g.txt

diff --git a/29-Brigde-And-Cut-Points/Edge.dart b/29-Brigde-And-Cut-Points/Edge.dart
new file mode 100644
index 0000000..3bee4ab
--- /dev/null
+++ b/29-Brigde-And-Cut-Points/Edge.dart
@@ -0,0 +1,12 @@
+class Edge {
+  int? v, w;
+  Edge(int v, int w){
+    this.v = v;
+    this.w = w;
+  }
+
+  @override
+  String toString(){
+    return ("$v-$w");
+  }
+}
\ No newline at end of file
diff --git a/29-Brigde-And-Cut-Points/FindBridges.dart b/29-Brigde-And-Cut-Points/FindBridges.dart
new file mode 100644
index 0000000..a3bf627
--- /dev/null
+++ b/29-Brigde-And-Cut-Points/FindBridges.dart
@@ -0,0 +1,108 @@
+import 'Graph.dart';
+import 'Edge.dart';
+import 'dart:io';
+import 'dart:math';
+
+/**
+ * 查找桥
+ */
+class FindBridges {
+  Graph? _G;
+
+  List? _visited;
+
+  List? _ord;
+
+  List? _low;
+
+  int cnt = 0;
+
+  List? res;
+
+  FindBridges(Graph G) {
+    this._G = G;
+    _visited = List.filled(G.V()!, false, growable: true);
+
+    res = List.filled(0, Edge, growable: true);
+    _ord = List.filled(G.V()!, 0, growable: true);
+    _low = List.filled(G.V()!, 0, growable: true);
+    cnt = 0;
+
+    for (int v = 0; v < _G!.V()!; v++) {
+      if (!_visited![v]) {
+        _dfs(v, v);
+      }
+    }
+  }
+
+  _dfs(int v, int parent) {
+    _visited![v] = true;
+    _ord![v] = cnt;
+    _low![v] = _ord![v];
+    cnt++;
+//    print("循环：${_G!.adj(v)}");
+    for (int w in _G!.adj(v))
+      if (!_visited![w]) {
+        _dfs(w, v);
+        _low![v] = [(_low![v] as int), (_low![w] as int)].reduce(min);
+//        print(" 最小值：${_low![v]}");
+        if (_low![w] > _ord![v]) {
+          res!.add(Edge(v, w));
+        }
+      } else if (w != parent) {
+        _low![v] = [(_low![v] as int), (_low![w] as int)].reduce(min);
+      }
+  }
+
+  result() {
+    return res;
+  }
+}
+
+void main() async {
+  File content = File("g.txt");
+  List<String> list = await content.readAsLines();
+  //读取到文件的顶点数量以及
+  int v = int.parse(list[0].split(" ")[0]);
+  int e = int.parse(list[0].split(" ")[1]);
+  Graph graph = Graph(v, e, list);
+
+  FindBridges fb = new FindBridges(graph);
+  print("Bridges in g : " + fb.result().toString());
+
+  File content2 = File("g2.txt");
+  List<String> list2 = await content2.readAsLines();
+  //读取到文件的顶点数量以及
+  int v2 = int.parse(list2[0].split(" ")[0]);
+  int e2 = int.parse(list2[0].split(" ")[1]);
+  Graph graph2 = Graph(v2, e2, list2);
+  FindBridges fb2 = new FindBridges(graph2);
+  print("Bridges in g2 : " + fb2.result().toString());
+
+  File content3 = File("g3.txt");
+  List<String> list3 = await content3.readAsLines();
+  //读取到文件的顶点数量以及
+  int v3 = int.parse(list3[0].split(" ")[0]);
+  int e3 = int.parse(list3[0].split(" ")[1]);
+  Graph graph3 = Graph(v3, e3, list3);
+  FindBridges fb3 = new FindBridges(graph3);
+  print("Bridges in g3 : " + fb3.result().toString());
+
+  File content4 = File("g4.txt");
+  List<String> list4 = await content4.readAsLines();
+  //读取到文件的顶点数量以及
+  int v4 = int.parse(list4[0].split(" ")[0]);
+  int e4 = int.parse(list4[0].split(" ")[1]);
+  Graph graph4 = Graph(v4, e4, list4);
+  FindBridges fb4 = new FindBridges(graph4);
+  print("Bridges in g4 : " + fb4.result().toString());
+
+  File content5 = File("tree.txt");
+  List<String> list5 = await content5.readAsLines();
+  //读取到文件的顶点数量以及
+  int v5 = int.parse(list5[0].split(" ")[0]);
+  int e5 = int.parse(list5[0].split(" ")[1]);
+  Graph graph5 = Graph(v5, e5, list5);
+  FindBridges fb_tree = new FindBridges(graph5);
+  print("Bridges in tree : " + fb_tree.result().toString());
+}
diff --git a/29-Brigde-And-Cut-Points/FindCutPoints.dart b/29-Brigde-And-Cut-Points/FindCutPoints.dart
new file mode 100644
index 0000000..f18398d
--- /dev/null
+++ b/29-Brigde-And-Cut-Points/FindCutPoints.dart
@@ -0,0 +1,96 @@
+import 'Graph.dart';
+import 'dart:collection';
+import 'dart:math';
+import 'dart:io';
+
+/**
+ * 查找割点
+ */
+class FindCutPoints {
+  Graph? _G;
+
+  List? _visited;
+
+  List? _ord;
+
+  List? _low;
+
+  int _cnt = 0;
+
+  HashSet<int>? res;
+
+  FindCutPoints(Graph G) {
+    this._G = G;
+    _visited = List.filled(_G!.V()!, false, growable: true);
+
+    res = HashSet();
+    _ord = List.filled(_G!.V()!, 0, growable: true);
+    _low = List.filled(_G!.V()!, 0, growable: true);
+    _cnt = 0;
+
+    for (int v = 0; v < _G!.V()!; v++) if (!_visited![v]) _dfs(v, v);
+  }
+
+  _dfs(int v, int parent) {
+    _visited![v] = true;
+    _ord![v] = _cnt;
+    _low![v] = _ord![v];
+    _cnt++;
+
+    int child = 0;
+
+    for (int w in _G!.adj(v))
+      if (!_visited![w]) {
+        _dfs(w, v);
+        _low![v] = [(_low![v] as int), (_low![w] as int)].reduce(min);
+
+        if (v != parent && _low![w] >= _ord![v]) res!.add(v);
+
+        child++;
+        if (v == parent && child > 1) res!.add(v);
+      } else if (w != parent)
+        _low![v] = [(_low![v] as int), (_low![w] as int)].reduce(min);
+  }
+
+  result() {
+    return res;
+  }
+}
+
+void main() async {
+  File content = File("g.txt");
+  List<String> list = await content.readAsLines();
+  //读取到文件的顶点数量以及
+  int v = int.parse(list[0].split(" ")[0]);
+  int e = int.parse(list[0].split(" ")[1]);
+  Graph graph = Graph(v, e, list);
+  FindCutPoints fc = new FindCutPoints(graph);
+  print("Cut Points in g : " + fc.result().toString());
+
+  File content2 = File("g2.txt");
+  List<String> list2 = await content2.readAsLines();
+  //读取到文件的顶点数量以及
+  int v2 = int.parse(list2[0].split(" ")[0]);
+  int e2 = int.parse(list2[0].split(" ")[1]);
+  Graph graph2 = Graph(v2, e2, list2);
+  FindCutPoints fc2 = new FindCutPoints(graph2);
+  print("Cut Points in g2 : " + fc2.result().toString());
+
+  File content3 = File("g3.txt");
+  List<String> list3 = await content3.readAsLines();
+  //读取到文件的顶点数量以及
+  int v3 = int.parse(list3[0].split(" ")[0]);
+  int e3 = int.parse(list3[0].split(" ")[1]);
+  Graph graph3 = Graph(v3, e3, list3);
+  FindCutPoints fc3 = new FindCutPoints(graph3);
+  print("Cut Points in g3 : " + fc3.result().toString());
+
+  File content5 = File("tree.txt");
+  List<String> list5 = await content5.readAsLines();
+  //读取到文件的顶点数量以及
+  int v5 = int.parse(list5[0].split(" ")[0]);
+  int e5 = int.parse(list5[0].split(" ")[1]);
+  Graph graph5 = Graph(v5, e5, list5);
+  FindCutPoints fc4 = new FindCutPoints(graph5);
+  print("Cut Points in tree : " + fc4.result().toString());
+}
diff --git a/29-Brigde-And-Cut-Points/Graph.dart b/29-Brigde-And-Cut-Points/Graph.dart
new file mode 100644
index 0000000..0d44faa
--- /dev/null
+++ b/29-Brigde-And-Cut-Points/Graph.dart
@@ -0,0 +1,80 @@
+import 'dart:collection';
+import 'dart:io';
+
+/**
+ * 图
+ */
+class Graph{
+  int? _V; //图的顶点数量
+  int? _E; //图的边的数量
+  List? _treeSet;
+
+  Graph(V, E, List list) {
+    _V = V;
+    _E = E;
+    if (V < 0) throw Exception("V must be non-negative");
+    if (E < 0) throw Exception("E must be non-negative");
+    _treeSet = List.generate(V, (_) => SplayTreeSet<int>(), growable: false);
+
+    for (int i = 1; i <= E; i++) {
+      int a = int.parse(list[i].split(" ")[0]);
+      validateVertex(a);
+      int b = int.parse(list[i].split(" ")[1]);
+      validateVertex(b);
+      (_treeSet![a] as SplayTreeSet).add(b);
+      (_treeSet![b] as SplayTreeSet).add(a);
+    }
+  }
+
+  validateVertex(int v) {
+    if (v < 0 || v >= _V!) throw new Exception("vertex  $v is invalid");
+  }
+
+  int? V() {
+    return _V;
+  }
+
+  bool hasEdge(int v, int w) {
+    validateVertex(v);
+    validateVertex(w);
+    return (_treeSet![v] as SplayTreeSet).contains(w);
+  }
+
+  int _degree(int v) {
+    return _treeSet![v].length;
+  }
+
+  int? E() {
+    return _E;
+  }
+
+  adj(int v) {
+    validateVertex(v);
+    return _treeSet![v];
+  }
+
+  @override
+  String toString() {
+    StringBuffer sb = new StringBuffer();
+    sb.write("V = $_V, E = $_E\n");
+    for (int j = 0; j < _V!; j++) {
+      sb.write("节点：$j ");
+      sb.write("${_treeSet![j].toString()} ");
+    sb.write('\n');
+    }
+    return sb.toString();
+  }
+}
+void main() async {
+  File content = File("g.txt");
+  List<String> list = await content.readAsLines();
+  //读取到文件的顶点数量以及
+  print(list[0].split(" ")[0]);
+  print(list[0].split(" ")[1]);
+  int v = int.parse(list[0].split(" ")[0]) ;
+  int e = int.parse(list[0].split(" ")[1]) ;
+//
+  Graph adjList= Graph(v, e, list);
+  print(adjList);
+
+}
diff --git a/29-Brigde-And-Cut-Points/g.txt b/29-Brigde-And-Cut-Points/g.txt
new file mode 100644
index 0000000..dbfa369
--- /dev/null
+++ b/29-Brigde-And-Cut-Points/g.txt
@@ -0,0 +1,9 @@
+7 8
+0 1
+0 2
+1 3
+2 3
+3 5
+4 5
+4 6
+5 6
\ No newline at end of file
diff --git a/29-Brigde-And-Cut-Points/g2.txt b/29-Brigde-And-Cut-Points/g2.txt
new file mode 100644
index 0000000..5f44c9f
--- /dev/null
+++ b/29-Brigde-And-Cut-Points/g2.txt
@@ -0,0 +1,17 @@
+12 16
+0 1
+0 2
+1 3
+2 3
+3 5
+4 5
+4 6
+4 7
+5 6
+6 8
+8 9
+8 10
+8 11
+9 10
+9 11
+10 11
\ No newline at end of file
diff --git a/29-Brigde-And-Cut-Points/g3.txt b/29-Brigde-And-Cut-Points/g3.txt
new file mode 100644
index 0000000..cb28a27
--- /dev/null
+++ b/29-Brigde-And-Cut-Points/g3.txt
@@ -0,0 +1,6 @@
+4 5
+0 1
+0 2
+1 2
+1 3
+2 3
\ No newline at end of file
diff --git a/29-Brigde-And-Cut-Points/g4.txt b/29-Brigde-And-Cut-Points/g4.txt
new file mode 100644
index 0000000..044f884
--- /dev/null
+++ b/29-Brigde-And-Cut-Points/g4.txt
@@ -0,0 +1,9 @@
+7 8
+0 1
+0 2
+1 3
+1 4
+2 3
+2 6
+3 5
+5 6
\ No newline at end of file
diff --git a/29-Brigde-And-Cut-Points/tree.txt b/29-Brigde-And-Cut-Points/tree.txt
new file mode 100644
index 0000000..dd25f18
--- /dev/null
+++ b/29-Brigde-And-Cut-Points/tree.txt
@@ -0,0 +1,7 @@
+7 6
+0 1
+0 3
+1 6
+2 3
+2 5
+3 4
\ No newline at end of file
diff --git a/30-Minimum-Tree-Spanning/CC.dart b/30-Minimum-Tree-Spanning/CC.dart
new file mode 100644
index 0000000..add8633
--- /dev/null
+++ b/30-Minimum-Tree-Spanning/CC.dart
@@ -0,0 +1,85 @@
+import 'Graph.dart';
+import 'dart:io';
+import 'dart:collection';
+import 'WeightedGraph.dart';
+/**
+ * 图的联通分量BFS
+ */
+class CC {
+  WeightedGraph? _G;
+
+  List? _visited;
+
+  int _cccount = 0;
+
+  CC(WeightedGraph G) {
+    this._G = G;
+    _visited = List.filled(G.V()!, 0, growable: true);
+
+    for (int i = 0; i < _visited!.length; i++) _visited![i] = -1;
+
+    for (int v = 0; v < G.V()!; v++) {
+      if (_visited![v] == -1) {
+        _bfs(v, _cccount);
+        _cccount++;
+      }
+    }
+  }
+
+  _bfs(int v, int ccid) {
+    ListQueue queue = ListQueue();
+    queue.add(v);
+    _visited![v] = ccid;
+    while (!queue.isEmpty) {
+      int v = queue.removeFirst();
+
+      for (int w in _G!.adj(v)) {
+        if (_visited![w] == -1) {
+          queue.add(w);
+          _visited![w] = ccid;
+        }
+      }
+    }
+  }
+
+  int count() {
+    return _cccount;
+  }
+
+  bool isConnected(int v, int w) {
+    _G!.validateVertex(v);
+    _G!.validateVertex(w);
+    return _visited![v] == _visited![w];
+  }
+
+  components() {
+    List? res = List.generate(_cccount, (_) => List.generate(0, (_) => 0),
+        growable: true);
+    for (int v = 0; v < _G!.V()!; v++) res[_visited![v]].add(v);
+    return res;
+  }
+}
+
+void main() async {
+  File content = File("g.txt");
+  List<String> list = await content.readAsLines();
+  //读取到文件的顶点数量以及
+  int v = int.parse(list[0].split(" ")[0]);
+  int e = int.parse(list[0].split(" ")[1]);
+//
+  WeightedGraph adjList = WeightedGraph(v, e, list);
+  CC cc = new CC(adjList);
+  print(cc.count());
+
+  print(cc.isConnected(0, 6));
+  print(cc.isConnected(5, 6));
+
+  List comp = cc.components();
+  for (int ccid = 0; ccid < comp.length; ccid++) {
+    print("$ccid  :: ");
+    for (int w in comp[ccid]) {
+      print("$w ");
+    }
+    print("");
+  }
+}
diff --git a/30-Minimum-Tree-Spanning/Edge.dart b/30-Minimum-Tree-Spanning/Edge.dart
new file mode 100644
index 0000000..3bee4ab
--- /dev/null
+++ b/30-Minimum-Tree-Spanning/Edge.dart
@@ -0,0 +1,12 @@
+class Edge {
+  int? v, w;
+  Edge(int v, int w){
+    this.v = v;
+    this.w = w;
+  }
+
+  @override
+  String toString(){
+    return ("$v-$w");
+  }
+}
\ No newline at end of file
diff --git a/30-Minimum-Tree-Spanning/Graph.dart b/30-Minimum-Tree-Spanning/Graph.dart
new file mode 100644
index 0000000..0d44faa
--- /dev/null
+++ b/30-Minimum-Tree-Spanning/Graph.dart
@@ -0,0 +1,80 @@
+import 'dart:collection';
+import 'dart:io';
+
+/**
+ * 图
+ */
+class Graph{
+  int? _V; //图的顶点数量
+  int? _E; //图的边的数量
+  List? _treeSet;
+
+  Graph(V, E, List list) {
+    _V = V;
+    _E = E;
+    if (V < 0) throw Exception("V must be non-negative");
+    if (E < 0) throw Exception("E must be non-negative");
+    _treeSet = List.generate(V, (_) => SplayTreeSet<int>(), growable: false);
+
+    for (int i = 1; i <= E; i++) {
+      int a = int.parse(list[i].split(" ")[0]);
+      validateVertex(a);
+      int b = int.parse(list[i].split(" ")[1]);
+      validateVertex(b);
+      (_treeSet![a] as SplayTreeSet).add(b);
+      (_treeSet![b] as SplayTreeSet).add(a);
+    }
+  }
+
+  validateVertex(int v) {
+    if (v < 0 || v >= _V!) throw new Exception("vertex  $v is invalid");
+  }
+
+  int? V() {
+    return _V;
+  }
+
+  bool hasEdge(int v, int w) {
+    validateVertex(v);
+    validateVertex(w);
+    return (_treeSet![v] as SplayTreeSet).contains(w);
+  }
+
+  int _degree(int v) {
+    return _treeSet![v].length;
+  }
+
+  int? E() {
+    return _E;
+  }
+
+  adj(int v) {
+    validateVertex(v);
+    return _treeSet![v];
+  }
+
+  @override
+  String toString() {
+    StringBuffer sb = new StringBuffer();
+    sb.write("V = $_V, E = $_E\n");
+    for (int j = 0; j < _V!; j++) {
+      sb.write("节点：$j ");
+      sb.write("${_treeSet![j].toString()} ");
+    sb.write('\n');
+    }
+    return sb.toString();
+  }
+}
+void main() async {
+  File content = File("g.txt");
+  List<String> list = await content.readAsLines();
+  //读取到文件的顶点数量以及
+  print(list[0].split(" ")[0]);
+  print(list[0].split(" ")[1]);
+  int v = int.parse(list[0].split(" ")[0]) ;
+  int e = int.parse(list[0].split(" ")[1]) ;
+//
+  Graph adjList= Graph(v, e, list);
+  print(adjList);
+
+}
diff --git a/30-Minimum-Tree-Spanning/Kruskal.dart b/30-Minimum-Tree-Spanning/Kruskal.dart
new file mode 100644
index 0000000..c48955a
--- /dev/null
+++ b/30-Minimum-Tree-Spanning/Kruskal.dart
@@ -0,0 +1,50 @@
+import 'WeightedGraph.dart';
+import 'WeightedEdge.dart';
+import 'CC.dart';
+import 'UF.dart';
+import 'dart:io';
+class Kruskal {
+  WeightedGraph? _G;
+
+  List? mst;
+
+  Kruskal(WeightedGraph G) {
+    this._G = G;
+    mst = List.filled(0, WeightedEdge, growable: true);
+
+    CC cc = new CC(G);
+    if (cc.count() > 1) return;
+
+    List? edges = List.filled(0, WeightedEdge, growable: true);
+    for (int v = 0; v < _G!.V()!; v++)
+      for (int w in G.adj(v))
+        if (v < w) edges.add(new WeightedEdge(v, w, G.getWeight(v, w)));
+
+    edges.sort();
+
+    UF uf = new UF(G.V()!);
+    for (WeightedEdge edge in edges) {
+      int v = edge.getV();
+      int w = edge.getW();
+      if (!uf.isConnected(v, w)) {
+        mst!.add(edge);
+        uf.unionElements(v, w);
+      }
+    }
+  }
+
+  result() {
+    return mst;
+  }
+}
+
+void main() async {
+  File content = File("g.txt");
+  List<String> list = await content.readAsLines();
+  //读取到文件的顶点数量以及
+  int v = int.parse(list[0].split(" ")[0]);
+  int e = int.parse(list[0].split(" ")[1]);
+  WeightedGraph g = new WeightedGraph(v,e,list);
+  Kruskal kruskal = new Kruskal(g);
+  print(kruskal.result());
+}
diff --git a/30-Minimum-Tree-Spanning/Prim.dart b/30-Minimum-Tree-Spanning/Prim.dart
new file mode 100644
index 0000000..dbdba26
--- /dev/null
+++ b/30-Minimum-Tree-Spanning/Prim.dart
@@ -0,0 +1,62 @@
+import 'WeightedGraph.dart';
+import 'WeightedEdge.dart';
+import 'CC.dart';
+import 'dart:collection';
+import 'dart:io';
+
+/**
+ * Prim算法中
+ * 需要使用到优先级队列
+ * 而dart中无优先级队列
+ */
+class Prim {
+  WeightedGraph? G;
+
+  List? mst;
+
+  Prim(WeightedGraph G) {
+    this.G = G;
+    mst = List.filled(0, WeightedEdge, growable: true);
+
+    CC cc = new CC(G);
+    if (cc.count() > 1) return;
+
+    List? _visited = List.filled(G.V()!, false, growable: true);
+    _visited[0] = true;
+    Queue pq = ListQueue();
+
+    for (int w in G.adj(0)) {
+      pq.add(new WeightedEdge(0, w, G.getWeight(0, w)));
+    }
+
+    while (!pq.isEmpty) {
+      WeightedEdge minEdge = pq.removeFirst();
+      if (_visited[minEdge.getV()] && _visited[minEdge.getW()]){
+        continue;
+      }
+      print("${minEdge.getV()}  ${minEdge.getW()} ${minEdge.getWeight()}");
+      mst!.add(minEdge);
+
+      int newv = _visited[minEdge.getV()] ? minEdge.getW() : minEdge.getV();
+      _visited[newv] = true;
+      for (int w in G.adj(newv))
+        if (!_visited[w])
+          pq.add(new WeightedEdge(newv, w, G.getWeight(newv, w)));
+    }
+  }
+
+  result() {
+    return mst;
+  }
+}
+
+void main() async {
+  File content = File("g.txt");
+  List<String> list = await content.readAsLines();
+  //读取到文件的顶点数量以及
+  int v = int.parse(list[0].split(" ")[0]);
+  int e = int.parse(list[0].split(" ")[1]);
+  WeightedGraph g = new WeightedGraph(v, e, list);
+  Prim prim = new Prim(g);
+  print(prim.result());
+}
diff --git a/30-Minimum-Tree-Spanning/UF.dart b/30-Minimum-Tree-Spanning/UF.dart
new file mode 100644
index 0000000..ce40e64
--- /dev/null
+++ b/30-Minimum-Tree-Spanning/UF.dart
@@ -0,0 +1,32 @@
+class UF{
+
+ List? parent;
+
+  UF(int n){
+    parent = List.filled(n,0, growable: true);
+    for(int i = 0 ; i < n ; i ++) {
+      parent![i] = i;
+    }
+  }
+
+  int find(int p){
+    if( p != parent![p] )
+      parent![p] = find( parent![p] );
+    return parent![p];
+  }
+
+   bool isConnected(int p , int q){
+    return find(p) == find(q);
+  }
+
+   unionElements(int p, int q){
+
+    int pRoot = find(p);
+    int qRoot = find(q);
+
+    if( pRoot == qRoot )
+      return;
+
+    parent![pRoot] = qRoot;
+  }
+}
\ No newline at end of file
diff --git a/30-Minimum-Tree-Spanning/WeightedEdge.dart b/30-Minimum-Tree-Spanning/WeightedEdge.dart
new file mode 100644
index 0000000..06c02c5
--- /dev/null
+++ b/30-Minimum-Tree-Spanning/WeightedEdge.dart
@@ -0,0 +1,31 @@
+class WeightedEdge implements Comparable {
+  int _v = 0;
+  int _w = 0;
+  int _weight = 0;
+
+  WeightedEdge(this._v, this._w, this._weight);
+
+  @override
+  int compareTo(other) {
+    // TODO: implement compareTo
+    return (_weight - other.getWeight()) as int;
+  }
+
+  int getV() {
+    return _v;
+  }
+
+  int getW() {
+    return _w;
+  }
+
+  int getWeight() {
+    return _weight;
+  }
+
+  @override
+  String toString() {
+    // TODO: implement toString
+    return ("($_v-$_w: $_weight)");
+  }
+}
diff --git a/30-Minimum-Tree-Spanning/WeightedGraph.dart b/30-Minimum-Tree-Spanning/WeightedGraph.dart
new file mode 100644
index 0000000..117a656
--- /dev/null
+++ b/30-Minimum-Tree-Spanning/WeightedGraph.dart
@@ -0,0 +1,101 @@
+import 'dart:collection';
+import 'dart:io';
+
+/**
+ * 无向有权图
+ */
+class WeightedGraph {
+  int? _V;
+
+  int? _E;
+
+  List? _adj;
+
+  WeightedGraph(V, E, List list) {
+    this._V = V;
+    this._E = E;
+
+    _adj = List.generate(_V!, (_) => SplayTreeMap<int, int>(), growable: false);
+
+    for (int i = 1; i <= E; i++) {
+      int a = int.parse(list[i].split(" ")[0]);
+      validateVertex(a);
+      int b = int.parse(list[i].split(" ")[1]);
+      validateVertex(b);
+      int weight = int.parse(list[i].split(" ")[2]);
+
+      if (a == b) throw new Exception("Self Loop is Detected!");
+      if (_adj![a].containsKey(b)) {
+        throw new Exception("Parallel Edges are Detected!");
+      }
+      _adj![a].putIfAbsent(b, () => weight);
+      _adj![b].putIfAbsent(a, () => weight);
+    }
+  }
+
+  validateVertex(int v) {
+    if (v < 0 || v >= (_V as int)) throw new Exception("vertex $v is invalid");
+  }
+
+  int? V() {
+    return _V;
+  }
+
+  int? E() {
+    return _E;
+  }
+
+  bool hasEdge(int v, int w) {
+    validateVertex(v);
+    validateVertex(w);
+    return _adj![v].containsKey(w);
+  }
+
+  adj(int v) {
+    validateVertex(v);
+    return (_adj![v] as SplayTreeMap).keys;
+  }
+
+  int getWeight(int v, int w) {
+    if (hasEdge(v, w)) return _adj![v][w];
+    throw new Exception("No edge $v-$w");
+  }
+
+  int degree(int v) {
+    validateVertex(v);
+    return _adj![v].size();
+  }
+
+  removeEdge(int v, int w) {
+    validateVertex(v);
+    validateVertex(w);
+    if (_adj![v].containsKey(w)) {
+      _E = _E! - 1;
+    }
+    ;
+    _adj![v].remove(w);
+    _adj![w].remove(v);
+  }
+  @override
+  String toString(){
+    StringBuffer sb = new StringBuffer();
+
+    sb.write("V = $_V, E = $E\n");
+    for(int v = 0; v < (_V as int); v ++){
+      sb.write("$v : ");
+      (_adj![v] as SplayTreeMap).entries.forEach((element) { sb.write("( ${element.key}:${element.value} )");});
+      sb.write('\n');
+    }
+    return sb.toString();
+  }
+}
+
+void main() async {
+  File content = File("g.txt");
+  List<String> list = await content.readAsLines();
+  //读取到文件的顶点数量以及
+  int v = int.parse(list[0].split(" ")[0]);
+  int e = int.parse(list[0].split(" ")[1]);
+  WeightedGraph g = new WeightedGraph(v, e, list);
+  print(g);
+}
diff --git a/30-Minimum-Tree-Spanning/g.txt b/30-Minimum-Tree-Spanning/g.txt
new file mode 100644
index 0000000..0b72a71
--- /dev/null
+++ b/30-Minimum-Tree-Spanning/g.txt
@@ -0,0 +1,13 @@
+7 12
+0 1 2
+0 3 7
+0 5 2
+1 2 1
+1 3 4
+1 4 3
+1 5 5
+2 4 4
+2 5 4
+3 4 1
+3 6 5
+4 6 7
\ No newline at end of file
diff --git a/README.md b/README.md
index 153199c..ab49ed8 100644
--- a/README.md
+++ b/README.md
@@ -38,6 +38,8 @@
     2. 图的联通分量
     3. 无向图的环检测
     4. 二分图检测
+29. 桥和割点
+30. 最小生成树
 
 #### SDK版本
 1. 版本：2.12.3

From dad74dfcbadcd78c30808a7ef7b3f9181306698c Mon Sep 17 00:00:00 2001
From: "tianqing.liang" <1>
Date: Fri, 24 Sep 2021 10:06:40 +0800
Subject: [PATCH 12/21] 'modify'

---
 06-Recursion/Solution3.dart                         | 6 +++---
 08-QuickSort-More/QuickSort2way.dart                | 2 +-
 08-QuickSort-More/QuickSort3way.dart                | 2 +-
 08-QuickSort/QuickSort.dart                         | 2 +-
 09-Binary-Search-More/up/BinarySearchFloor.dart     | 2 +-
 09-Binary-Search-More/up/BinarySearchLowerCeil.dart | 2 +-
 09-Binary-Search-More/up/BinarySearchUp.dart        | 2 +-
 09-Binary-Search/BinarySearchR.dart                 | 2 +-
 10-Binary-Search-Tree/BST.dart                      | 2 +-
 17-Trie/Trie.dart                                   | 2 +-
 20-Red-Black-Tree/Main2.dart                        | 1 -
 20-Red-Black-Tree/RBTree.dart                       | 1 -
 21-Hash-Table/Main.dart                             | 1 -
 21-Hash-Table/RBTree.dart                           | 1 -
 21-Hash-Table/Solution.dart                         | 1 -
 22-CountingSort-And-RadixSort/Solution.dart         | 4 ++--
 23-MSDSort-And-BucketSort/BucketSort.dart           | 1 -
 23-MSDSort-And-BucketSort/SortingHelper.dart        | 2 +-
 18 files changed, 15 insertions(+), 21 deletions(-)

diff --git a/06-Recursion/Solution3.dart b/06-Recursion/Solution3.dart
index 2018b91..244e58a 100644
--- a/06-Recursion/Solution3.dart
+++ b/06-Recursion/Solution3.dart
@@ -14,9 +14,9 @@ class Solution3{
       }
     }
     return dummyHead.next;
-    if(head == null){
-      return head;
-    }
+//    if(head == null){
+//      return head;
+//    }
 //    ListNode? res = removeElements(head.next!, val);
 //    if(head.val == val){
 //      return res;
diff --git a/08-QuickSort-More/QuickSort2way.dart b/08-QuickSort-More/QuickSort2way.dart
index cd21a02..f455ede 100644
--- a/08-QuickSort-More/QuickSort2way.dart
+++ b/08-QuickSort-More/QuickSort2way.dart
@@ -5,7 +5,7 @@ import 'dart:math';
  * 二路快排
  */
 class QuickSort2way {
-  _QuickSort2way() {}
+  QuickSort2way() {}
 
   static sort2ways(List arr) {
     Random rnd = new Random();
diff --git a/08-QuickSort-More/QuickSort3way.dart b/08-QuickSort-More/QuickSort3way.dart
index 1519e9a..67bcd9f 100644
--- a/08-QuickSort-More/QuickSort3way.dart
+++ b/08-QuickSort-More/QuickSort3way.dart
@@ -4,7 +4,7 @@ import 'dart:math';
  * 三路快排
  */
 class QuickSort3way {
-  _QuickSort3way() {}
+  QuickSort3way() {}
 
   static sort3ways(List arr) {
     Random rnd = new Random();
diff --git a/08-QuickSort/QuickSort.dart b/08-QuickSort/QuickSort.dart
index e34637b..50e2c03 100644
--- a/08-QuickSort/QuickSort.dart
+++ b/08-QuickSort/QuickSort.dart
@@ -1,7 +1,7 @@
 import 'ArrayGenerator.dart';
 import 'dart:math';
 class QuickSort{
-  _QuickSort(){
+  QuickSort(){
   }
   static sort(List arr){
     _sortDetail(arr,0,arr.length-1);
diff --git a/09-Binary-Search-More/up/BinarySearchFloor.dart b/09-Binary-Search-More/up/BinarySearchFloor.dart
index 6b1a252..e18b7ca 100644
--- a/09-Binary-Search-More/up/BinarySearchFloor.dart
+++ b/09-Binary-Search-More/up/BinarySearchFloor.dart
@@ -4,7 +4,7 @@ import 'ArrayGenerator.dart';
  * 二分搜索
  */
 class BinarySearch {
-  _BinarySearch() {}
+  BinarySearch() {}
 
   static int search<T>(List data, T target) {
     int left = 0, right = data.length - 1;
diff --git a/09-Binary-Search-More/up/BinarySearchLowerCeil.dart b/09-Binary-Search-More/up/BinarySearchLowerCeil.dart
index 41f9c1a..37a120e 100644
--- a/09-Binary-Search-More/up/BinarySearchLowerCeil.dart
+++ b/09-Binary-Search-More/up/BinarySearchLowerCeil.dart
@@ -4,7 +4,7 @@ import 'ArrayGenerator.dart';
  * 二分搜索
  */
 class BinarySearch {
-  _BinarySearch() {}
+  BinarySearch() {}
 
   static int search<T>(List data, T target) {
     int left = 0, right = data.length - 1;
diff --git a/09-Binary-Search-More/up/BinarySearchUp.dart b/09-Binary-Search-More/up/BinarySearchUp.dart
index 6f3c827..3402f41 100644
--- a/09-Binary-Search-More/up/BinarySearchUp.dart
+++ b/09-Binary-Search-More/up/BinarySearchUp.dart
@@ -5,7 +5,7 @@ import 'ArrayGenerator.dart';
  */
 class BinarySearch{
 
-  _BinarySearch(){}
+  BinarySearch(){}
 
   static int search<T>(List data,T target){
 
diff --git a/09-Binary-Search/BinarySearchR.dart b/09-Binary-Search/BinarySearchR.dart
index b5b2233..1d502eb 100644
--- a/09-Binary-Search/BinarySearchR.dart
+++ b/09-Binary-Search/BinarySearchR.dart
@@ -5,7 +5,7 @@ import 'ArrayGenerator.dart';
  */
 class BinarySearch{
 
-  _BinarySearch(){}
+  BinarySearch(){}
 
   static int search<T>(List data,T target){
 
diff --git a/10-Binary-Search-Tree/BST.dart b/10-Binary-Search-Tree/BST.dart
index 457aeef..62709d8 100644
--- a/10-Binary-Search-Tree/BST.dart
+++ b/10-Binary-Search-Tree/BST.dart
@@ -266,7 +266,7 @@ class BST<T extends Comparable<T>> {
     if( node == null )
       return null;
 
-    if( e!.compareTo(node.e!) < 0 ){
+    if( e.compareTo(node.e!) < 0 ){
       node.left = _removeNode(node.left! , e);
       return node;
     }
diff --git a/17-Trie/Trie.dart b/17-Trie/Trie.dart
index b837900..3b5801a 100644
--- a/17-Trie/Trie.dart
+++ b/17-Trie/Trie.dart
@@ -45,7 +45,7 @@ class Trie {
   // 查询是否在Trie中有单词以prefix为前缀
   bool isPrefix(String prefix){
     _Node? cur = _root;
-    for(int i = 0 ; i < prefix!.length ; i ++){
+    for(int i = 0 ; i < prefix.length ; i ++){
       String c = prefix[i];
       if(cur!.next![c] == null){
         return false;
diff --git a/20-Red-Black-Tree/Main2.dart b/20-Red-Black-Tree/Main2.dart
index b688dec..6c14df5 100644
--- a/20-Red-Black-Tree/Main2.dart
+++ b/20-Red-Black-Tree/Main2.dart
@@ -1,4 +1,3 @@
-import 'FileOperator.dart';
 import 'BST.dart';
 import 'AVLTree.dart';
 import 'dart:math';
diff --git a/20-Red-Black-Tree/RBTree.dart b/20-Red-Black-Tree/RBTree.dart
index de9404d..a1dc4c6 100644
--- a/20-Red-Black-Tree/RBTree.dart
+++ b/20-Red-Black-Tree/RBTree.dart
@@ -1,4 +1,3 @@
-import 'dart:math';
 import 'FileOperator.dart';
 
 /**
diff --git a/21-Hash-Table/Main.dart b/21-Hash-Table/Main.dart
index 500716d..d174112 100644
--- a/21-Hash-Table/Main.dart
+++ b/21-Hash-Table/Main.dart
@@ -1,6 +1,5 @@
 import 'dart:collection';
 import 'FileOperator.dart';
-import 'HashTable.dart';
 import 'HashTableSec.dart';
 
 void main() async{
diff --git a/21-Hash-Table/RBTree.dart b/21-Hash-Table/RBTree.dart
index de9404d..a1dc4c6 100644
--- a/21-Hash-Table/RBTree.dart
+++ b/21-Hash-Table/RBTree.dart
@@ -1,4 +1,3 @@
-import 'dart:math';
 import 'FileOperator.dart';
 
 /**
diff --git a/21-Hash-Table/Solution.dart b/21-Hash-Table/Solution.dart
index 6993fe8..dfa1768 100644
--- a/21-Hash-Table/Solution.dart
+++ b/21-Hash-Table/Solution.dart
@@ -1,4 +1,3 @@
-import 'dart:collection';
 
 /**
  * dart中无类型提升
diff --git a/22-CountingSort-And-RadixSort/Solution.dart b/22-CountingSort-And-RadixSort/Solution.dart
index e0ab967..be92962 100644
--- a/22-CountingSort-And-RadixSort/Solution.dart
+++ b/22-CountingSort-And-RadixSort/Solution.dart
@@ -1,7 +1,7 @@
 class Solution {
   sortColors(List<int> nums) {
     List? cnt = List.filled(3, 0, growable: true);
-    for (int num in nums!) {
+    for (int num in nums) {
       cnt[num]++;}
 
     for (int i = 0; i < cnt[0]; i++) {
@@ -20,7 +20,7 @@ class Solution {
     int R = 3;
 
     List? cnt = List.filled(3, 0, growable: true);
-    for (int num in nums!) {
+    for (int num in nums) {
       cnt[num]++;
     }
 
diff --git a/23-MSDSort-And-BucketSort/BucketSort.dart b/23-MSDSort-And-BucketSort/BucketSort.dart
index 4855baf..262c885 100644
--- a/23-MSDSort-And-BucketSort/BucketSort.dart
+++ b/23-MSDSort-And-BucketSort/BucketSort.dart
@@ -1,5 +1,4 @@
 import 'ArrayGenerator.dart';
-import 'SortingHelper.dart';
 import 'dart:math';
 
 class BucketSort {
diff --git a/23-MSDSort-And-BucketSort/SortingHelper.dart b/23-MSDSort-And-BucketSort/SortingHelper.dart
index 23e28d5..e437ed2 100644
--- a/23-MSDSort-And-BucketSort/SortingHelper.dart
+++ b/23-MSDSort-And-BucketSort/SortingHelper.dart
@@ -43,6 +43,6 @@ class SortingHelper {
     print("开始时间：$startTime : 结束时间:$endTime");
     double time = (endTime - startTime) / 1000.0;
     if (!SortingHelper.isSorted(arr)) throw new Exception(sortname + " failed");
-    print("$sortname , n = ${arr!.length}: $time s");
+    print("$sortname , n = ${arr.length}: $time s");
   }
 }

From 00148c042c33c00f86d3d52a95b490aa650e2110 Mon Sep 17 00:00:00 2001
From: "tianqing.liang" <1>
Date: Thu, 17 Mar 2022 17:30:24 +0800
Subject: [PATCH 13/21] =?UTF-8?q?=E6=96=B0=E5=A2=9Epython=E7=AE=97?=
 =?UTF-8?q?=E6=B3=95=E5=92=8C=E6=95=B0=E6=8D=AE=E7=BB=93=E6=9E=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../01-Linear-Search}/LinearSearch.dart       |  0
 .../02-Selection-Sort}/Selection-sort.dart    |  0
 .../02-Selection-Sort}/SortingHelper.dart     |  0
 .../03-Insertion-Sort}/ArrayGenerator.dart    |  0
 .../03-Insertion-Sort}/InsertionSort.dart     |  0
 .../03-Insertion-Sort}/SortingHelper.dart     |  0
 .../04-Stack-Queue}/ArrayQueue.dart           |  0
 .../04-Stack-Queue}/ArrayStack.dart           |  0
 .../04-Stack-Queue}/LoopQueue.dart            |  0
 .../04-Stack-Queue}/Main.dart                 |  0
 .../04-Stack-Queue}/Queue.dart                |  0
 .../04-Stack-Queue}/Stack.dart                |  0
 .../05-LinkedList}/LinkedList.dart            |  0
 .../05-LinkedList}/LinkedListQueue.dart       |  0
 .../05-LinkedList}/LinkedListStatck.dart      |  0
 .../05-LinkedList}/Queue.dart                 |  0
 .../05-LinkedList}/Stack.dart                 |  0
 .../05-LinkedList}/main.dart                  |  0
 .../06-Recursion}/ListNode.dart               |  0
 .../06-Recursion}/Solution3.dart              |  0
 {06-Recursion => dart/06-Recursion}/Sum.dart  |  0
 .../07-MergeSort-More}/ArrayGenerator.dart    |  0
 .../07-MergeSort-More}/MergeSort.dart         |  0
 .../07-MergeSort-More}/SortingHelper.dart     |  0
 .../07-MergeSort}/ArrayGenerator.dart         |  0
 .../07-MergeSort}/MergeSort.dart              |  0
 .../07-MergeSort}/SortingHelper.dart          |  0
 .../08-QuickSort-More}/ArrayGenerator.dart    |  0
 .../08-QuickSort-More}/QuickSort2way.dart     |  0
 .../08-QuickSort-More}/QuickSort3way.dart     |  0
 .../08-QuickSort-More}/SortingHelper.dart     |  0
 .../08-QuickSort}/ArrayGenerator.dart         |  0
 .../08-QuickSort}/QuickSort.dart              |  0
 .../08-QuickSort}/SortingHelper.dart          |  0
 .../up/ArrayGenerator.dart                    |  0
 .../up/BinarySearchCeil.dart                  |  0
 .../up/BinarySearchFloor.dart                 |  0
 .../up/BinarySearchLowerCeil.dart             |  0
 .../up/BinarySearchUp.dart                    |  0
 .../09-Binary-Search}/ArrayGenerator.dart     |  0
 .../09-Binary-Search}/BinarySearchR.dart      |  0
 .../10-Binary-Search-Tree}/BST.dart           |  0
 .../10-Binary-Search-Tree}/LinkedList.dart    |  0
 .../LinkedListQueue.dart                      |  0
 .../LinkedListStatck.dart                     |  0
 .../10-Binary-Search-Tree}/Main.dart          |  0
 .../10-Binary-Search-Tree}/Queue.dart         |  0
 .../10-Binary-Search-Tree}/Stack.dart         |  0
 .../11-Set-And-Map}/BST.dart                  |  0
 .../11-Set-And-Map}/BSTMap.dart               |  0
 .../11-Set-And-Map}/BSTSet.dart               |  0
 .../11-Set-And-Map}/FileOperator.dart         |  0
 .../11-Set-And-Map}/LinkedList.dart           |  0
 .../11-Set-And-Map}/LinkedListMap.dart        |  0
 .../11-Set-And-Map}/LinkedListQueue.dart      |  0
 .../11-Set-And-Map}/LinkedListStatck.dart     |  0
 .../11-Set-And-Map}/Main.dart                 |  0
 .../11-Set-And-Map}/Map.dart                  |  0
 .../11-Set-And-Map}/Queue.dart                |  0
 .../11-Set-And-Map}/Set.dart                  |  0
 .../11-Set-And-Map}/Stack.dart                |  0
 .../11-Set-And-Map}/text1.txt                 |  0
 .../11-Set-And-Map}/text2.txt                 |  0
 {12-Heap => dart/12-Heap}/HeapSort.dart       |  0
 {12-Heap => dart/12-Heap}/Main.dart           |  0
 {12-Heap => dart/12-Heap}/MaxHeap.dart        |  0
 {12-Heap => dart/12-Heap}/MinHeap.dart        |  0
 {12-Heap => dart/12-Heap}/SortingHelper.dart  |  0
 .../13-Priority-Queue}/MaxHeap.dart           |  0
 .../13-Priority-Queue}/PriorityQueue.dart     |  0
 .../13-Priority-Queue}/Queue.dart             |  0
 .../14-Bubble-Sort}/BubblSort.dart            |  0
 .../14-Bubble-Sort}/SortingHelper.dart        |  0
 .../15-Shell-Sort}/ArrayGenerator.dart        |  0
 .../15-Shell-Sort}/ShellSort.dart             |  0
 .../15-Shell-Sort}/SortingHelper.dart         |  0
 .../16-Segment-Tree}/Main.dart                |  0
 .../16-Segment-Tree}/Merger.dart              |  0
 .../16-Segment-Tree}/Segment.dart             |  0
 {17-Trie => dart/17-Trie}/FileOperator.dart   |  0
 {17-Trie => dart/17-Trie}/Main.dart           |  0
 {17-Trie => dart/17-Trie}/Trie.dart           |  0
 {17-Trie => dart/17-Trie}/text1.txt           |  0
 {17-Trie => dart/17-Trie}/text2.txt           |  0
 .../18-Union-Find}/Main.dart                  |  0
 {18-Union-Find => dart/18-Union-Find}/UF.dart |  0
 .../18-Union-Find}/UnionFind1.dart            |  0
 .../18-Union-Find}/UnionFind2.dart            |  0
 .../18-Union-Find}/UnionFind3.dart            |  0
 .../18-Union-Find}/UnionFind4.dart            |  0
 .../18-Union-Find}/UnionFind5.dart            |  0
 .../18-Union-Find}/UnionFind6.dart            |  0
 .../19-AVL-Tree}/AVLTree.dart                 |  0
 {19-AVL-Tree => dart/19-AVL-Tree}/BST.dart    |  0
 .../19-AVL-Tree}/FileOperator.dart            |  0
 {19-AVL-Tree => dart/19-AVL-Tree}/Main.dart   |  0
 {19-AVL-Tree => dart/19-AVL-Tree}/text1.txt   |  0
 {19-AVL-Tree => dart/19-AVL-Tree}/text2.txt   |  0
 .../20-Red-Black-Tree}/AVLTree.dart           |  0
 .../20-Red-Black-Tree}/BST.dart               |  0
 .../20-Red-Black-Tree}/FileOperator.dart      |  0
 .../20-Red-Black-Tree}/Main.dart              |  0
 .../20-Red-Black-Tree}/Main2.dart             |  0
 .../20-Red-Black-Tree}/RBTree.dart            |  0
 .../20-Red-Black-Tree}/text1.txt              |  0
 .../20-Red-Black-Tree}/text2.txt              |  0
 .../21-Hash-Table}/AVLTree.dart               |  0
 .../21-Hash-Table}/BST.dart                   |  0
 .../21-Hash-Table}/FileOperator.dart          |  0
 .../21-Hash-Table}/HashTable.dart             |  0
 .../21-Hash-Table}/HashTableSec.dart          |  0
 .../21-Hash-Table}/Main.dart                  |  0
 .../21-Hash-Table}/RBTree.dart                |  0
 .../21-Hash-Table}/Solution.dart              |  0
 .../21-Hash-Table}/text1.txt                  |  0
 .../21-Hash-Table}/text2.txt                  |  0
 .../ArrayGenerator.dart                       |  0
 .../LSDSort.dart                              |  0
 .../22-CountingSort-And-RadixSort}/Main.dart  |  0
 .../ShellSort.dart                            |  0
 .../Solution.dart                             |  0
 .../SortingHelper.dart                        |  0
 .../Student.dart                              |  0
 .../ArrayGenerator.dart                       |  0
 .../BucketSort.dart                           |  0
 .../23-MSDSort-And-BucketSort}/MSDSort.dart   |  0
 .../23-MSDSort-And-BucketSort}/MergeSort.dart |  0
 .../23-MSDSort-And-BucketSort}/ShellSort.dart |  0
 .../SortingHelper.dart                        |  0
 .../24-SubString-Match}/FileOperator.dart     |  0
 .../24-SubString-Match}/LC1392-hash.dart      |  0
 .../24-SubString-Match}/LC1392.dart           |  0
 .../LC187-RollingHash.dart                    |  0
 .../24-SubString-Match}/LC187.dart            |  0
 .../24-SubString-Match}/Solution.dart         |  0
 .../24-SubString-Match}/Solution2.dart        |  0
 .../24-SubString-Match}/SubstringMatch.dart   |  0
 .../SubstringMatchHelper.dart                 |  0
 .../24-SubString-Match}/text1.txt             |  0
 .../24-SubString-Match}/text2.txt             |  0
 .../25-GraphBascis}/AdjList.dart              |  0
 .../25-GraphBascis}/AdjMatrix.dart            |  0
 .../25-GraphBascis}/AdjSet.dart               |  0
 .../25-GraphBascis}/FileOperator.dart         |  0
 .../25-GraphBascis}/Graph.dart                |  0
 .../25-GraphBascis}/ListItem.dart             |  0
 {25-GraphBascis => dart/25-GraphBascis}/g.txt |  0
 .../26-GraphDFS}/AdjMatrix.dart               |  0
 .../26-GraphDFS}/AdjMatrixDFS.dart            |  0
 .../26-GraphDFS}/ArrayStack.dart              |  0
 {26-GraphDFS => dart/26-GraphDFS}/Graph.dart  |  0
 .../26-GraphDFS}/GraphDFS.dart                |  0
 .../26-GraphDFS}/GraphDFSnr.dart              |  0
 {26-GraphDFS => dart/26-GraphDFS}/Stack.dart  |  0
 {26-GraphDFS => dart/26-GraphDFS}/g.txt       |  0
 .../BipartitionDetection.dart                 |  0
 .../27-GraphDFS-Application}/CC.dart          |  0
 .../CycleDetection.dart                       |  0
 .../27-GraphDFS-Application}/Graph.dart       |  0
 .../27-GraphDFS-Application}/GraphDFS.dart    |  0
 .../SingleSourcePath.dart                     |  0
 .../27-GraphDFS-Application}/g.txt            |  0
 .../27-GraphDFS-Application}/g2.txt           |  0
 .../27-GraphDFS-Application}/g3.txt           |  0
 .../28-Graph-BFS}/BipartitionDetection.dart   |  0
 {28-Graph-BFS => dart/28-Graph-BFS}/CC.dart   |  0
 .../28-Graph-BFS}/CycleDetection.dart         |  0
 .../28-Graph-BFS}/Graph.dart                  |  0
 .../28-Graph-BFS}/GraphBFS.dart               |  0
 .../28-Graph-BFS}/SingleSourcePath.dart       |  0
 {28-Graph-BFS => dart/28-Graph-BFS}/g.txt     |  0
 {28-Graph-BFS => dart/28-Graph-BFS}/g2.txt    |  0
 {28-Graph-BFS => dart/28-Graph-BFS}/g3.txt    |  0
 .../29-Brigde-And-Cut-Points}/Edge.dart       |  0
 .../FindBridges.dart                          |  0
 .../FindCutPoints.dart                        |  0
 .../29-Brigde-And-Cut-Points}/Graph.dart      |  0
 .../29-Brigde-And-Cut-Points}/g.txt           |  0
 .../29-Brigde-And-Cut-Points}/g2.txt          |  0
 .../29-Brigde-And-Cut-Points}/g3.txt          |  0
 .../29-Brigde-And-Cut-Points}/g4.txt          |  0
 .../29-Brigde-And-Cut-Points}/tree.txt        |  0
 .../30-Minimum-Tree-Spanning}/CC.dart         |  0
 .../30-Minimum-Tree-Spanning}/Edge.dart       |  0
 .../30-Minimum-Tree-Spanning}/Graph.dart      |  0
 .../30-Minimum-Tree-Spanning}/Kruskal.dart    |  0
 .../30-Minimum-Tree-Spanning}/Prim.dart       |  0
 .../30-Minimum-Tree-Spanning}/UF.dart         |  0
 .../WeightedEdge.dart                         |  0
 .../WeightedGraph.dart                        |  0
 .../30-Minimum-Tree-Spanning}/g.txt           |  0
 Dart-Basic.iml => dart/Dart-Basic.iml         |  0
 python/sort.py                                | 52 +++++++++++++++++++
 193 files changed, 52 insertions(+)
 rename {01-Linear-Search => dart/01-Linear-Search}/LinearSearch.dart (100%)
 rename {02-Selection-Sort => dart/02-Selection-Sort}/Selection-sort.dart (100%)
 rename {02-Selection-Sort => dart/02-Selection-Sort}/SortingHelper.dart (100%)
 rename {03-Insertion-Sort => dart/03-Insertion-Sort}/ArrayGenerator.dart (100%)
 rename {03-Insertion-Sort => dart/03-Insertion-Sort}/InsertionSort.dart (100%)
 rename {03-Insertion-Sort => dart/03-Insertion-Sort}/SortingHelper.dart (100%)
 rename {04-Stack-Queue => dart/04-Stack-Queue}/ArrayQueue.dart (100%)
 rename {04-Stack-Queue => dart/04-Stack-Queue}/ArrayStack.dart (100%)
 rename {04-Stack-Queue => dart/04-Stack-Queue}/LoopQueue.dart (100%)
 rename {04-Stack-Queue => dart/04-Stack-Queue}/Main.dart (100%)
 rename {04-Stack-Queue => dart/04-Stack-Queue}/Queue.dart (100%)
 rename {04-Stack-Queue => dart/04-Stack-Queue}/Stack.dart (100%)
 rename {05-LinkedList => dart/05-LinkedList}/LinkedList.dart (100%)
 rename {05-LinkedList => dart/05-LinkedList}/LinkedListQueue.dart (100%)
 rename {05-LinkedList => dart/05-LinkedList}/LinkedListStatck.dart (100%)
 rename {05-LinkedList => dart/05-LinkedList}/Queue.dart (100%)
 rename {05-LinkedList => dart/05-LinkedList}/Stack.dart (100%)
 rename {05-LinkedList => dart/05-LinkedList}/main.dart (100%)
 rename {06-Recursion => dart/06-Recursion}/ListNode.dart (100%)
 rename {06-Recursion => dart/06-Recursion}/Solution3.dart (100%)
 rename {06-Recursion => dart/06-Recursion}/Sum.dart (100%)
 rename {07-MergeSort-More => dart/07-MergeSort-More}/ArrayGenerator.dart (100%)
 rename {07-MergeSort-More => dart/07-MergeSort-More}/MergeSort.dart (100%)
 rename {07-MergeSort-More => dart/07-MergeSort-More}/SortingHelper.dart (100%)
 rename {07-MergeSort => dart/07-MergeSort}/ArrayGenerator.dart (100%)
 rename {07-MergeSort => dart/07-MergeSort}/MergeSort.dart (100%)
 rename {07-MergeSort => dart/07-MergeSort}/SortingHelper.dart (100%)
 rename {08-QuickSort-More => dart/08-QuickSort-More}/ArrayGenerator.dart (100%)
 rename {08-QuickSort-More => dart/08-QuickSort-More}/QuickSort2way.dart (100%)
 rename {08-QuickSort-More => dart/08-QuickSort-More}/QuickSort3way.dart (100%)
 rename {08-QuickSort-More => dart/08-QuickSort-More}/SortingHelper.dart (100%)
 rename {08-QuickSort => dart/08-QuickSort}/ArrayGenerator.dart (100%)
 rename {08-QuickSort => dart/08-QuickSort}/QuickSort.dart (100%)
 rename {08-QuickSort => dart/08-QuickSort}/SortingHelper.dart (100%)
 rename {09-Binary-Search-More => dart/09-Binary-Search-More}/up/ArrayGenerator.dart (100%)
 rename {09-Binary-Search-More => dart/09-Binary-Search-More}/up/BinarySearchCeil.dart (100%)
 rename {09-Binary-Search-More => dart/09-Binary-Search-More}/up/BinarySearchFloor.dart (100%)
 rename {09-Binary-Search-More => dart/09-Binary-Search-More}/up/BinarySearchLowerCeil.dart (100%)
 rename {09-Binary-Search-More => dart/09-Binary-Search-More}/up/BinarySearchUp.dart (100%)
 rename {09-Binary-Search => dart/09-Binary-Search}/ArrayGenerator.dart (100%)
 rename {09-Binary-Search => dart/09-Binary-Search}/BinarySearchR.dart (100%)
 rename {10-Binary-Search-Tree => dart/10-Binary-Search-Tree}/BST.dart (100%)
 rename {10-Binary-Search-Tree => dart/10-Binary-Search-Tree}/LinkedList.dart (100%)
 rename {10-Binary-Search-Tree => dart/10-Binary-Search-Tree}/LinkedListQueue.dart (100%)
 rename {10-Binary-Search-Tree => dart/10-Binary-Search-Tree}/LinkedListStatck.dart (100%)
 rename {10-Binary-Search-Tree => dart/10-Binary-Search-Tree}/Main.dart (100%)
 rename {10-Binary-Search-Tree => dart/10-Binary-Search-Tree}/Queue.dart (100%)
 rename {10-Binary-Search-Tree => dart/10-Binary-Search-Tree}/Stack.dart (100%)
 rename {11-Set-And-Map => dart/11-Set-And-Map}/BST.dart (100%)
 rename {11-Set-And-Map => dart/11-Set-And-Map}/BSTMap.dart (100%)
 rename {11-Set-And-Map => dart/11-Set-And-Map}/BSTSet.dart (100%)
 rename {11-Set-And-Map => dart/11-Set-And-Map}/FileOperator.dart (100%)
 rename {11-Set-And-Map => dart/11-Set-And-Map}/LinkedList.dart (100%)
 rename {11-Set-And-Map => dart/11-Set-And-Map}/LinkedListMap.dart (100%)
 rename {11-Set-And-Map => dart/11-Set-And-Map}/LinkedListQueue.dart (100%)
 rename {11-Set-And-Map => dart/11-Set-And-Map}/LinkedListStatck.dart (100%)
 rename {11-Set-And-Map => dart/11-Set-And-Map}/Main.dart (100%)
 rename {11-Set-And-Map => dart/11-Set-And-Map}/Map.dart (100%)
 rename {11-Set-And-Map => dart/11-Set-And-Map}/Queue.dart (100%)
 rename {11-Set-And-Map => dart/11-Set-And-Map}/Set.dart (100%)
 rename {11-Set-And-Map => dart/11-Set-And-Map}/Stack.dart (100%)
 rename {11-Set-And-Map => dart/11-Set-And-Map}/text1.txt (100%)
 rename {11-Set-And-Map => dart/11-Set-And-Map}/text2.txt (100%)
 rename {12-Heap => dart/12-Heap}/HeapSort.dart (100%)
 rename {12-Heap => dart/12-Heap}/Main.dart (100%)
 rename {12-Heap => dart/12-Heap}/MaxHeap.dart (100%)
 rename {12-Heap => dart/12-Heap}/MinHeap.dart (100%)
 rename {12-Heap => dart/12-Heap}/SortingHelper.dart (100%)
 rename {13-Priority-Queue => dart/13-Priority-Queue}/MaxHeap.dart (100%)
 rename {13-Priority-Queue => dart/13-Priority-Queue}/PriorityQueue.dart (100%)
 rename {13-Priority-Queue => dart/13-Priority-Queue}/Queue.dart (100%)
 rename {14-Bubble-Sort => dart/14-Bubble-Sort}/BubblSort.dart (100%)
 rename {14-Bubble-Sort => dart/14-Bubble-Sort}/SortingHelper.dart (100%)
 rename {15-Shell-Sort => dart/15-Shell-Sort}/ArrayGenerator.dart (100%)
 rename {15-Shell-Sort => dart/15-Shell-Sort}/ShellSort.dart (100%)
 rename {15-Shell-Sort => dart/15-Shell-Sort}/SortingHelper.dart (100%)
 rename {16-Segment-Tree => dart/16-Segment-Tree}/Main.dart (100%)
 rename {16-Segment-Tree => dart/16-Segment-Tree}/Merger.dart (100%)
 rename {16-Segment-Tree => dart/16-Segment-Tree}/Segment.dart (100%)
 rename {17-Trie => dart/17-Trie}/FileOperator.dart (100%)
 rename {17-Trie => dart/17-Trie}/Main.dart (100%)
 rename {17-Trie => dart/17-Trie}/Trie.dart (100%)
 rename {17-Trie => dart/17-Trie}/text1.txt (100%)
 rename {17-Trie => dart/17-Trie}/text2.txt (100%)
 rename {18-Union-Find => dart/18-Union-Find}/Main.dart (100%)
 rename {18-Union-Find => dart/18-Union-Find}/UF.dart (100%)
 rename {18-Union-Find => dart/18-Union-Find}/UnionFind1.dart (100%)
 rename {18-Union-Find => dart/18-Union-Find}/UnionFind2.dart (100%)
 rename {18-Union-Find => dart/18-Union-Find}/UnionFind3.dart (100%)
 rename {18-Union-Find => dart/18-Union-Find}/UnionFind4.dart (100%)
 rename {18-Union-Find => dart/18-Union-Find}/UnionFind5.dart (100%)
 rename {18-Union-Find => dart/18-Union-Find}/UnionFind6.dart (100%)
 rename {19-AVL-Tree => dart/19-AVL-Tree}/AVLTree.dart (100%)
 rename {19-AVL-Tree => dart/19-AVL-Tree}/BST.dart (100%)
 rename {19-AVL-Tree => dart/19-AVL-Tree}/FileOperator.dart (100%)
 rename {19-AVL-Tree => dart/19-AVL-Tree}/Main.dart (100%)
 rename {19-AVL-Tree => dart/19-AVL-Tree}/text1.txt (100%)
 rename {19-AVL-Tree => dart/19-AVL-Tree}/text2.txt (100%)
 rename {20-Red-Black-Tree => dart/20-Red-Black-Tree}/AVLTree.dart (100%)
 rename {20-Red-Black-Tree => dart/20-Red-Black-Tree}/BST.dart (100%)
 rename {20-Red-Black-Tree => dart/20-Red-Black-Tree}/FileOperator.dart (100%)
 rename {20-Red-Black-Tree => dart/20-Red-Black-Tree}/Main.dart (100%)
 rename {20-Red-Black-Tree => dart/20-Red-Black-Tree}/Main2.dart (100%)
 rename {20-Red-Black-Tree => dart/20-Red-Black-Tree}/RBTree.dart (100%)
 rename {20-Red-Black-Tree => dart/20-Red-Black-Tree}/text1.txt (100%)
 rename {20-Red-Black-Tree => dart/20-Red-Black-Tree}/text2.txt (100%)
 rename {21-Hash-Table => dart/21-Hash-Table}/AVLTree.dart (100%)
 rename {21-Hash-Table => dart/21-Hash-Table}/BST.dart (100%)
 rename {21-Hash-Table => dart/21-Hash-Table}/FileOperator.dart (100%)
 rename {21-Hash-Table => dart/21-Hash-Table}/HashTable.dart (100%)
 rename {21-Hash-Table => dart/21-Hash-Table}/HashTableSec.dart (100%)
 rename {21-Hash-Table => dart/21-Hash-Table}/Main.dart (100%)
 rename {21-Hash-Table => dart/21-Hash-Table}/RBTree.dart (100%)
 rename {21-Hash-Table => dart/21-Hash-Table}/Solution.dart (100%)
 rename {21-Hash-Table => dart/21-Hash-Table}/text1.txt (100%)
 rename {21-Hash-Table => dart/21-Hash-Table}/text2.txt (100%)
 rename {22-CountingSort-And-RadixSort => dart/22-CountingSort-And-RadixSort}/ArrayGenerator.dart (100%)
 rename {22-CountingSort-And-RadixSort => dart/22-CountingSort-And-RadixSort}/LSDSort.dart (100%)
 rename {22-CountingSort-And-RadixSort => dart/22-CountingSort-And-RadixSort}/Main.dart (100%)
 rename {22-CountingSort-And-RadixSort => dart/22-CountingSort-And-RadixSort}/ShellSort.dart (100%)
 rename {22-CountingSort-And-RadixSort => dart/22-CountingSort-And-RadixSort}/Solution.dart (100%)
 rename {22-CountingSort-And-RadixSort => dart/22-CountingSort-And-RadixSort}/SortingHelper.dart (100%)
 rename {22-CountingSort-And-RadixSort => dart/22-CountingSort-And-RadixSort}/Student.dart (100%)
 rename {23-MSDSort-And-BucketSort => dart/23-MSDSort-And-BucketSort}/ArrayGenerator.dart (100%)
 rename {23-MSDSort-And-BucketSort => dart/23-MSDSort-And-BucketSort}/BucketSort.dart (100%)
 rename {23-MSDSort-And-BucketSort => dart/23-MSDSort-And-BucketSort}/MSDSort.dart (100%)
 rename {23-MSDSort-And-BucketSort => dart/23-MSDSort-And-BucketSort}/MergeSort.dart (100%)
 rename {23-MSDSort-And-BucketSort => dart/23-MSDSort-And-BucketSort}/ShellSort.dart (100%)
 rename {23-MSDSort-And-BucketSort => dart/23-MSDSort-And-BucketSort}/SortingHelper.dart (100%)
 rename {24-SubString-Match => dart/24-SubString-Match}/FileOperator.dart (100%)
 rename {24-SubString-Match => dart/24-SubString-Match}/LC1392-hash.dart (100%)
 rename {24-SubString-Match => dart/24-SubString-Match}/LC1392.dart (100%)
 rename {24-SubString-Match => dart/24-SubString-Match}/LC187-RollingHash.dart (100%)
 rename {24-SubString-Match => dart/24-SubString-Match}/LC187.dart (100%)
 rename {24-SubString-Match => dart/24-SubString-Match}/Solution.dart (100%)
 rename {24-SubString-Match => dart/24-SubString-Match}/Solution2.dart (100%)
 rename {24-SubString-Match => dart/24-SubString-Match}/SubstringMatch.dart (100%)
 rename {24-SubString-Match => dart/24-SubString-Match}/SubstringMatchHelper.dart (100%)
 rename {24-SubString-Match => dart/24-SubString-Match}/text1.txt (100%)
 rename {24-SubString-Match => dart/24-SubString-Match}/text2.txt (100%)
 rename {25-GraphBascis => dart/25-GraphBascis}/AdjList.dart (100%)
 rename {25-GraphBascis => dart/25-GraphBascis}/AdjMatrix.dart (100%)
 rename {25-GraphBascis => dart/25-GraphBascis}/AdjSet.dart (100%)
 rename {25-GraphBascis => dart/25-GraphBascis}/FileOperator.dart (100%)
 rename {25-GraphBascis => dart/25-GraphBascis}/Graph.dart (100%)
 rename {25-GraphBascis => dart/25-GraphBascis}/ListItem.dart (100%)
 rename {25-GraphBascis => dart/25-GraphBascis}/g.txt (100%)
 rename {26-GraphDFS => dart/26-GraphDFS}/AdjMatrix.dart (100%)
 rename {26-GraphDFS => dart/26-GraphDFS}/AdjMatrixDFS.dart (100%)
 rename {26-GraphDFS => dart/26-GraphDFS}/ArrayStack.dart (100%)
 rename {26-GraphDFS => dart/26-GraphDFS}/Graph.dart (100%)
 rename {26-GraphDFS => dart/26-GraphDFS}/GraphDFS.dart (100%)
 rename {26-GraphDFS => dart/26-GraphDFS}/GraphDFSnr.dart (100%)
 rename {26-GraphDFS => dart/26-GraphDFS}/Stack.dart (100%)
 rename {26-GraphDFS => dart/26-GraphDFS}/g.txt (100%)
 rename {27-GraphDFS-Application => dart/27-GraphDFS-Application}/BipartitionDetection.dart (100%)
 rename {27-GraphDFS-Application => dart/27-GraphDFS-Application}/CC.dart (100%)
 rename {27-GraphDFS-Application => dart/27-GraphDFS-Application}/CycleDetection.dart (100%)
 rename {27-GraphDFS-Application => dart/27-GraphDFS-Application}/Graph.dart (100%)
 rename {27-GraphDFS-Application => dart/27-GraphDFS-Application}/GraphDFS.dart (100%)
 rename {27-GraphDFS-Application => dart/27-GraphDFS-Application}/SingleSourcePath.dart (100%)
 rename {27-GraphDFS-Application => dart/27-GraphDFS-Application}/g.txt (100%)
 rename {27-GraphDFS-Application => dart/27-GraphDFS-Application}/g2.txt (100%)
 rename {27-GraphDFS-Application => dart/27-GraphDFS-Application}/g3.txt (100%)
 rename {28-Graph-BFS => dart/28-Graph-BFS}/BipartitionDetection.dart (100%)
 rename {28-Graph-BFS => dart/28-Graph-BFS}/CC.dart (100%)
 rename {28-Graph-BFS => dart/28-Graph-BFS}/CycleDetection.dart (100%)
 rename {28-Graph-BFS => dart/28-Graph-BFS}/Graph.dart (100%)
 rename {28-Graph-BFS => dart/28-Graph-BFS}/GraphBFS.dart (100%)
 rename {28-Graph-BFS => dart/28-Graph-BFS}/SingleSourcePath.dart (100%)
 rename {28-Graph-BFS => dart/28-Graph-BFS}/g.txt (100%)
 rename {28-Graph-BFS => dart/28-Graph-BFS}/g2.txt (100%)
 rename {28-Graph-BFS => dart/28-Graph-BFS}/g3.txt (100%)
 rename {29-Brigde-And-Cut-Points => dart/29-Brigde-And-Cut-Points}/Edge.dart (100%)
 rename {29-Brigde-And-Cut-Points => dart/29-Brigde-And-Cut-Points}/FindBridges.dart (100%)
 rename {29-Brigde-And-Cut-Points => dart/29-Brigde-And-Cut-Points}/FindCutPoints.dart (100%)
 rename {29-Brigde-And-Cut-Points => dart/29-Brigde-And-Cut-Points}/Graph.dart (100%)
 rename {29-Brigde-And-Cut-Points => dart/29-Brigde-And-Cut-Points}/g.txt (100%)
 rename {29-Brigde-And-Cut-Points => dart/29-Brigde-And-Cut-Points}/g2.txt (100%)
 rename {29-Brigde-And-Cut-Points => dart/29-Brigde-And-Cut-Points}/g3.txt (100%)
 rename {29-Brigde-And-Cut-Points => dart/29-Brigde-And-Cut-Points}/g4.txt (100%)
 rename {29-Brigde-And-Cut-Points => dart/29-Brigde-And-Cut-Points}/tree.txt (100%)
 rename {30-Minimum-Tree-Spanning => dart/30-Minimum-Tree-Spanning}/CC.dart (100%)
 rename {30-Minimum-Tree-Spanning => dart/30-Minimum-Tree-Spanning}/Edge.dart (100%)
 rename {30-Minimum-Tree-Spanning => dart/30-Minimum-Tree-Spanning}/Graph.dart (100%)
 rename {30-Minimum-Tree-Spanning => dart/30-Minimum-Tree-Spanning}/Kruskal.dart (100%)
 rename {30-Minimum-Tree-Spanning => dart/30-Minimum-Tree-Spanning}/Prim.dart (100%)
 rename {30-Minimum-Tree-Spanning => dart/30-Minimum-Tree-Spanning}/UF.dart (100%)
 rename {30-Minimum-Tree-Spanning => dart/30-Minimum-Tree-Spanning}/WeightedEdge.dart (100%)
 rename {30-Minimum-Tree-Spanning => dart/30-Minimum-Tree-Spanning}/WeightedGraph.dart (100%)
 rename {30-Minimum-Tree-Spanning => dart/30-Minimum-Tree-Spanning}/g.txt (100%)
 rename Dart-Basic.iml => dart/Dart-Basic.iml (100%)
 create mode 100644 python/sort.py

diff --git a/01-Linear-Search/LinearSearch.dart b/dart/01-Linear-Search/LinearSearch.dart
similarity index 100%
rename from 01-Linear-Search/LinearSearch.dart
rename to dart/01-Linear-Search/LinearSearch.dart
diff --git a/02-Selection-Sort/Selection-sort.dart b/dart/02-Selection-Sort/Selection-sort.dart
similarity index 100%
rename from 02-Selection-Sort/Selection-sort.dart
rename to dart/02-Selection-Sort/Selection-sort.dart
diff --git a/02-Selection-Sort/SortingHelper.dart b/dart/02-Selection-Sort/SortingHelper.dart
similarity index 100%
rename from 02-Selection-Sort/SortingHelper.dart
rename to dart/02-Selection-Sort/SortingHelper.dart
diff --git a/03-Insertion-Sort/ArrayGenerator.dart b/dart/03-Insertion-Sort/ArrayGenerator.dart
similarity index 100%
rename from 03-Insertion-Sort/ArrayGenerator.dart
rename to dart/03-Insertion-Sort/ArrayGenerator.dart
diff --git a/03-Insertion-Sort/InsertionSort.dart b/dart/03-Insertion-Sort/InsertionSort.dart
similarity index 100%
rename from 03-Insertion-Sort/InsertionSort.dart
rename to dart/03-Insertion-Sort/InsertionSort.dart
diff --git a/03-Insertion-Sort/SortingHelper.dart b/dart/03-Insertion-Sort/SortingHelper.dart
similarity index 100%
rename from 03-Insertion-Sort/SortingHelper.dart
rename to dart/03-Insertion-Sort/SortingHelper.dart
diff --git a/04-Stack-Queue/ArrayQueue.dart b/dart/04-Stack-Queue/ArrayQueue.dart
similarity index 100%
rename from 04-Stack-Queue/ArrayQueue.dart
rename to dart/04-Stack-Queue/ArrayQueue.dart
diff --git a/04-Stack-Queue/ArrayStack.dart b/dart/04-Stack-Queue/ArrayStack.dart
similarity index 100%
rename from 04-Stack-Queue/ArrayStack.dart
rename to dart/04-Stack-Queue/ArrayStack.dart
diff --git a/04-Stack-Queue/LoopQueue.dart b/dart/04-Stack-Queue/LoopQueue.dart
similarity index 100%
rename from 04-Stack-Queue/LoopQueue.dart
rename to dart/04-Stack-Queue/LoopQueue.dart
diff --git a/04-Stack-Queue/Main.dart b/dart/04-Stack-Queue/Main.dart
similarity index 100%
rename from 04-Stack-Queue/Main.dart
rename to dart/04-Stack-Queue/Main.dart
diff --git a/04-Stack-Queue/Queue.dart b/dart/04-Stack-Queue/Queue.dart
similarity index 100%
rename from 04-Stack-Queue/Queue.dart
rename to dart/04-Stack-Queue/Queue.dart
diff --git a/04-Stack-Queue/Stack.dart b/dart/04-Stack-Queue/Stack.dart
similarity index 100%
rename from 04-Stack-Queue/Stack.dart
rename to dart/04-Stack-Queue/Stack.dart
diff --git a/05-LinkedList/LinkedList.dart b/dart/05-LinkedList/LinkedList.dart
similarity index 100%
rename from 05-LinkedList/LinkedList.dart
rename to dart/05-LinkedList/LinkedList.dart
diff --git a/05-LinkedList/LinkedListQueue.dart b/dart/05-LinkedList/LinkedListQueue.dart
similarity index 100%
rename from 05-LinkedList/LinkedListQueue.dart
rename to dart/05-LinkedList/LinkedListQueue.dart
diff --git a/05-LinkedList/LinkedListStatck.dart b/dart/05-LinkedList/LinkedListStatck.dart
similarity index 100%
rename from 05-LinkedList/LinkedListStatck.dart
rename to dart/05-LinkedList/LinkedListStatck.dart
diff --git a/05-LinkedList/Queue.dart b/dart/05-LinkedList/Queue.dart
similarity index 100%
rename from 05-LinkedList/Queue.dart
rename to dart/05-LinkedList/Queue.dart
diff --git a/05-LinkedList/Stack.dart b/dart/05-LinkedList/Stack.dart
similarity index 100%
rename from 05-LinkedList/Stack.dart
rename to dart/05-LinkedList/Stack.dart
diff --git a/05-LinkedList/main.dart b/dart/05-LinkedList/main.dart
similarity index 100%
rename from 05-LinkedList/main.dart
rename to dart/05-LinkedList/main.dart
diff --git a/06-Recursion/ListNode.dart b/dart/06-Recursion/ListNode.dart
similarity index 100%
rename from 06-Recursion/ListNode.dart
rename to dart/06-Recursion/ListNode.dart
diff --git a/06-Recursion/Solution3.dart b/dart/06-Recursion/Solution3.dart
similarity index 100%
rename from 06-Recursion/Solution3.dart
rename to dart/06-Recursion/Solution3.dart
diff --git a/06-Recursion/Sum.dart b/dart/06-Recursion/Sum.dart
similarity index 100%
rename from 06-Recursion/Sum.dart
rename to dart/06-Recursion/Sum.dart
diff --git a/07-MergeSort-More/ArrayGenerator.dart b/dart/07-MergeSort-More/ArrayGenerator.dart
similarity index 100%
rename from 07-MergeSort-More/ArrayGenerator.dart
rename to dart/07-MergeSort-More/ArrayGenerator.dart
diff --git a/07-MergeSort-More/MergeSort.dart b/dart/07-MergeSort-More/MergeSort.dart
similarity index 100%
rename from 07-MergeSort-More/MergeSort.dart
rename to dart/07-MergeSort-More/MergeSort.dart
diff --git a/07-MergeSort-More/SortingHelper.dart b/dart/07-MergeSort-More/SortingHelper.dart
similarity index 100%
rename from 07-MergeSort-More/SortingHelper.dart
rename to dart/07-MergeSort-More/SortingHelper.dart
diff --git a/07-MergeSort/ArrayGenerator.dart b/dart/07-MergeSort/ArrayGenerator.dart
similarity index 100%
rename from 07-MergeSort/ArrayGenerator.dart
rename to dart/07-MergeSort/ArrayGenerator.dart
diff --git a/07-MergeSort/MergeSort.dart b/dart/07-MergeSort/MergeSort.dart
similarity index 100%
rename from 07-MergeSort/MergeSort.dart
rename to dart/07-MergeSort/MergeSort.dart
diff --git a/07-MergeSort/SortingHelper.dart b/dart/07-MergeSort/SortingHelper.dart
similarity index 100%
rename from 07-MergeSort/SortingHelper.dart
rename to dart/07-MergeSort/SortingHelper.dart
diff --git a/08-QuickSort-More/ArrayGenerator.dart b/dart/08-QuickSort-More/ArrayGenerator.dart
similarity index 100%
rename from 08-QuickSort-More/ArrayGenerator.dart
rename to dart/08-QuickSort-More/ArrayGenerator.dart
diff --git a/08-QuickSort-More/QuickSort2way.dart b/dart/08-QuickSort-More/QuickSort2way.dart
similarity index 100%
rename from 08-QuickSort-More/QuickSort2way.dart
rename to dart/08-QuickSort-More/QuickSort2way.dart
diff --git a/08-QuickSort-More/QuickSort3way.dart b/dart/08-QuickSort-More/QuickSort3way.dart
similarity index 100%
rename from 08-QuickSort-More/QuickSort3way.dart
rename to dart/08-QuickSort-More/QuickSort3way.dart
diff --git a/08-QuickSort-More/SortingHelper.dart b/dart/08-QuickSort-More/SortingHelper.dart
similarity index 100%
rename from 08-QuickSort-More/SortingHelper.dart
rename to dart/08-QuickSort-More/SortingHelper.dart
diff --git a/08-QuickSort/ArrayGenerator.dart b/dart/08-QuickSort/ArrayGenerator.dart
similarity index 100%
rename from 08-QuickSort/ArrayGenerator.dart
rename to dart/08-QuickSort/ArrayGenerator.dart
diff --git a/08-QuickSort/QuickSort.dart b/dart/08-QuickSort/QuickSort.dart
similarity index 100%
rename from 08-QuickSort/QuickSort.dart
rename to dart/08-QuickSort/QuickSort.dart
diff --git a/08-QuickSort/SortingHelper.dart b/dart/08-QuickSort/SortingHelper.dart
similarity index 100%
rename from 08-QuickSort/SortingHelper.dart
rename to dart/08-QuickSort/SortingHelper.dart
diff --git a/09-Binary-Search-More/up/ArrayGenerator.dart b/dart/09-Binary-Search-More/up/ArrayGenerator.dart
similarity index 100%
rename from 09-Binary-Search-More/up/ArrayGenerator.dart
rename to dart/09-Binary-Search-More/up/ArrayGenerator.dart
diff --git a/09-Binary-Search-More/up/BinarySearchCeil.dart b/dart/09-Binary-Search-More/up/BinarySearchCeil.dart
similarity index 100%
rename from 09-Binary-Search-More/up/BinarySearchCeil.dart
rename to dart/09-Binary-Search-More/up/BinarySearchCeil.dart
diff --git a/09-Binary-Search-More/up/BinarySearchFloor.dart b/dart/09-Binary-Search-More/up/BinarySearchFloor.dart
similarity index 100%
rename from 09-Binary-Search-More/up/BinarySearchFloor.dart
rename to dart/09-Binary-Search-More/up/BinarySearchFloor.dart
diff --git a/09-Binary-Search-More/up/BinarySearchLowerCeil.dart b/dart/09-Binary-Search-More/up/BinarySearchLowerCeil.dart
similarity index 100%
rename from 09-Binary-Search-More/up/BinarySearchLowerCeil.dart
rename to dart/09-Binary-Search-More/up/BinarySearchLowerCeil.dart
diff --git a/09-Binary-Search-More/up/BinarySearchUp.dart b/dart/09-Binary-Search-More/up/BinarySearchUp.dart
similarity index 100%
rename from 09-Binary-Search-More/up/BinarySearchUp.dart
rename to dart/09-Binary-Search-More/up/BinarySearchUp.dart
diff --git a/09-Binary-Search/ArrayGenerator.dart b/dart/09-Binary-Search/ArrayGenerator.dart
similarity index 100%
rename from 09-Binary-Search/ArrayGenerator.dart
rename to dart/09-Binary-Search/ArrayGenerator.dart
diff --git a/09-Binary-Search/BinarySearchR.dart b/dart/09-Binary-Search/BinarySearchR.dart
similarity index 100%
rename from 09-Binary-Search/BinarySearchR.dart
rename to dart/09-Binary-Search/BinarySearchR.dart
diff --git a/10-Binary-Search-Tree/BST.dart b/dart/10-Binary-Search-Tree/BST.dart
similarity index 100%
rename from 10-Binary-Search-Tree/BST.dart
rename to dart/10-Binary-Search-Tree/BST.dart
diff --git a/10-Binary-Search-Tree/LinkedList.dart b/dart/10-Binary-Search-Tree/LinkedList.dart
similarity index 100%
rename from 10-Binary-Search-Tree/LinkedList.dart
rename to dart/10-Binary-Search-Tree/LinkedList.dart
diff --git a/10-Binary-Search-Tree/LinkedListQueue.dart b/dart/10-Binary-Search-Tree/LinkedListQueue.dart
similarity index 100%
rename from 10-Binary-Search-Tree/LinkedListQueue.dart
rename to dart/10-Binary-Search-Tree/LinkedListQueue.dart
diff --git a/10-Binary-Search-Tree/LinkedListStatck.dart b/dart/10-Binary-Search-Tree/LinkedListStatck.dart
similarity index 100%
rename from 10-Binary-Search-Tree/LinkedListStatck.dart
rename to dart/10-Binary-Search-Tree/LinkedListStatck.dart
diff --git a/10-Binary-Search-Tree/Main.dart b/dart/10-Binary-Search-Tree/Main.dart
similarity index 100%
rename from 10-Binary-Search-Tree/Main.dart
rename to dart/10-Binary-Search-Tree/Main.dart
diff --git a/10-Binary-Search-Tree/Queue.dart b/dart/10-Binary-Search-Tree/Queue.dart
similarity index 100%
rename from 10-Binary-Search-Tree/Queue.dart
rename to dart/10-Binary-Search-Tree/Queue.dart
diff --git a/10-Binary-Search-Tree/Stack.dart b/dart/10-Binary-Search-Tree/Stack.dart
similarity index 100%
rename from 10-Binary-Search-Tree/Stack.dart
rename to dart/10-Binary-Search-Tree/Stack.dart
diff --git a/11-Set-And-Map/BST.dart b/dart/11-Set-And-Map/BST.dart
similarity index 100%
rename from 11-Set-And-Map/BST.dart
rename to dart/11-Set-And-Map/BST.dart
diff --git a/11-Set-And-Map/BSTMap.dart b/dart/11-Set-And-Map/BSTMap.dart
similarity index 100%
rename from 11-Set-And-Map/BSTMap.dart
rename to dart/11-Set-And-Map/BSTMap.dart
diff --git a/11-Set-And-Map/BSTSet.dart b/dart/11-Set-And-Map/BSTSet.dart
similarity index 100%
rename from 11-Set-And-Map/BSTSet.dart
rename to dart/11-Set-And-Map/BSTSet.dart
diff --git a/11-Set-And-Map/FileOperator.dart b/dart/11-Set-And-Map/FileOperator.dart
similarity index 100%
rename from 11-Set-And-Map/FileOperator.dart
rename to dart/11-Set-And-Map/FileOperator.dart
diff --git a/11-Set-And-Map/LinkedList.dart b/dart/11-Set-And-Map/LinkedList.dart
similarity index 100%
rename from 11-Set-And-Map/LinkedList.dart
rename to dart/11-Set-And-Map/LinkedList.dart
diff --git a/11-Set-And-Map/LinkedListMap.dart b/dart/11-Set-And-Map/LinkedListMap.dart
similarity index 100%
rename from 11-Set-And-Map/LinkedListMap.dart
rename to dart/11-Set-And-Map/LinkedListMap.dart
diff --git a/11-Set-And-Map/LinkedListQueue.dart b/dart/11-Set-And-Map/LinkedListQueue.dart
similarity index 100%
rename from 11-Set-And-Map/LinkedListQueue.dart
rename to dart/11-Set-And-Map/LinkedListQueue.dart
diff --git a/11-Set-And-Map/LinkedListStatck.dart b/dart/11-Set-And-Map/LinkedListStatck.dart
similarity index 100%
rename from 11-Set-And-Map/LinkedListStatck.dart
rename to dart/11-Set-And-Map/LinkedListStatck.dart
diff --git a/11-Set-And-Map/Main.dart b/dart/11-Set-And-Map/Main.dart
similarity index 100%
rename from 11-Set-And-Map/Main.dart
rename to dart/11-Set-And-Map/Main.dart
diff --git a/11-Set-And-Map/Map.dart b/dart/11-Set-And-Map/Map.dart
similarity index 100%
rename from 11-Set-And-Map/Map.dart
rename to dart/11-Set-And-Map/Map.dart
diff --git a/11-Set-And-Map/Queue.dart b/dart/11-Set-And-Map/Queue.dart
similarity index 100%
rename from 11-Set-And-Map/Queue.dart
rename to dart/11-Set-And-Map/Queue.dart
diff --git a/11-Set-And-Map/Set.dart b/dart/11-Set-And-Map/Set.dart
similarity index 100%
rename from 11-Set-And-Map/Set.dart
rename to dart/11-Set-And-Map/Set.dart
diff --git a/11-Set-And-Map/Stack.dart b/dart/11-Set-And-Map/Stack.dart
similarity index 100%
rename from 11-Set-And-Map/Stack.dart
rename to dart/11-Set-And-Map/Stack.dart
diff --git a/11-Set-And-Map/text1.txt b/dart/11-Set-And-Map/text1.txt
similarity index 100%
rename from 11-Set-And-Map/text1.txt
rename to dart/11-Set-And-Map/text1.txt
diff --git a/11-Set-And-Map/text2.txt b/dart/11-Set-And-Map/text2.txt
similarity index 100%
rename from 11-Set-And-Map/text2.txt
rename to dart/11-Set-And-Map/text2.txt
diff --git a/12-Heap/HeapSort.dart b/dart/12-Heap/HeapSort.dart
similarity index 100%
rename from 12-Heap/HeapSort.dart
rename to dart/12-Heap/HeapSort.dart
diff --git a/12-Heap/Main.dart b/dart/12-Heap/Main.dart
similarity index 100%
rename from 12-Heap/Main.dart
rename to dart/12-Heap/Main.dart
diff --git a/12-Heap/MaxHeap.dart b/dart/12-Heap/MaxHeap.dart
similarity index 100%
rename from 12-Heap/MaxHeap.dart
rename to dart/12-Heap/MaxHeap.dart
diff --git a/12-Heap/MinHeap.dart b/dart/12-Heap/MinHeap.dart
similarity index 100%
rename from 12-Heap/MinHeap.dart
rename to dart/12-Heap/MinHeap.dart
diff --git a/12-Heap/SortingHelper.dart b/dart/12-Heap/SortingHelper.dart
similarity index 100%
rename from 12-Heap/SortingHelper.dart
rename to dart/12-Heap/SortingHelper.dart
diff --git a/13-Priority-Queue/MaxHeap.dart b/dart/13-Priority-Queue/MaxHeap.dart
similarity index 100%
rename from 13-Priority-Queue/MaxHeap.dart
rename to dart/13-Priority-Queue/MaxHeap.dart
diff --git a/13-Priority-Queue/PriorityQueue.dart b/dart/13-Priority-Queue/PriorityQueue.dart
similarity index 100%
rename from 13-Priority-Queue/PriorityQueue.dart
rename to dart/13-Priority-Queue/PriorityQueue.dart
diff --git a/13-Priority-Queue/Queue.dart b/dart/13-Priority-Queue/Queue.dart
similarity index 100%
rename from 13-Priority-Queue/Queue.dart
rename to dart/13-Priority-Queue/Queue.dart
diff --git a/14-Bubble-Sort/BubblSort.dart b/dart/14-Bubble-Sort/BubblSort.dart
similarity index 100%
rename from 14-Bubble-Sort/BubblSort.dart
rename to dart/14-Bubble-Sort/BubblSort.dart
diff --git a/14-Bubble-Sort/SortingHelper.dart b/dart/14-Bubble-Sort/SortingHelper.dart
similarity index 100%
rename from 14-Bubble-Sort/SortingHelper.dart
rename to dart/14-Bubble-Sort/SortingHelper.dart
diff --git a/15-Shell-Sort/ArrayGenerator.dart b/dart/15-Shell-Sort/ArrayGenerator.dart
similarity index 100%
rename from 15-Shell-Sort/ArrayGenerator.dart
rename to dart/15-Shell-Sort/ArrayGenerator.dart
diff --git a/15-Shell-Sort/ShellSort.dart b/dart/15-Shell-Sort/ShellSort.dart
similarity index 100%
rename from 15-Shell-Sort/ShellSort.dart
rename to dart/15-Shell-Sort/ShellSort.dart
diff --git a/15-Shell-Sort/SortingHelper.dart b/dart/15-Shell-Sort/SortingHelper.dart
similarity index 100%
rename from 15-Shell-Sort/SortingHelper.dart
rename to dart/15-Shell-Sort/SortingHelper.dart
diff --git a/16-Segment-Tree/Main.dart b/dart/16-Segment-Tree/Main.dart
similarity index 100%
rename from 16-Segment-Tree/Main.dart
rename to dart/16-Segment-Tree/Main.dart
diff --git a/16-Segment-Tree/Merger.dart b/dart/16-Segment-Tree/Merger.dart
similarity index 100%
rename from 16-Segment-Tree/Merger.dart
rename to dart/16-Segment-Tree/Merger.dart
diff --git a/16-Segment-Tree/Segment.dart b/dart/16-Segment-Tree/Segment.dart
similarity index 100%
rename from 16-Segment-Tree/Segment.dart
rename to dart/16-Segment-Tree/Segment.dart
diff --git a/17-Trie/FileOperator.dart b/dart/17-Trie/FileOperator.dart
similarity index 100%
rename from 17-Trie/FileOperator.dart
rename to dart/17-Trie/FileOperator.dart
diff --git a/17-Trie/Main.dart b/dart/17-Trie/Main.dart
similarity index 100%
rename from 17-Trie/Main.dart
rename to dart/17-Trie/Main.dart
diff --git a/17-Trie/Trie.dart b/dart/17-Trie/Trie.dart
similarity index 100%
rename from 17-Trie/Trie.dart
rename to dart/17-Trie/Trie.dart
diff --git a/17-Trie/text1.txt b/dart/17-Trie/text1.txt
similarity index 100%
rename from 17-Trie/text1.txt
rename to dart/17-Trie/text1.txt
diff --git a/17-Trie/text2.txt b/dart/17-Trie/text2.txt
similarity index 100%
rename from 17-Trie/text2.txt
rename to dart/17-Trie/text2.txt
diff --git a/18-Union-Find/Main.dart b/dart/18-Union-Find/Main.dart
similarity index 100%
rename from 18-Union-Find/Main.dart
rename to dart/18-Union-Find/Main.dart
diff --git a/18-Union-Find/UF.dart b/dart/18-Union-Find/UF.dart
similarity index 100%
rename from 18-Union-Find/UF.dart
rename to dart/18-Union-Find/UF.dart
diff --git a/18-Union-Find/UnionFind1.dart b/dart/18-Union-Find/UnionFind1.dart
similarity index 100%
rename from 18-Union-Find/UnionFind1.dart
rename to dart/18-Union-Find/UnionFind1.dart
diff --git a/18-Union-Find/UnionFind2.dart b/dart/18-Union-Find/UnionFind2.dart
similarity index 100%
rename from 18-Union-Find/UnionFind2.dart
rename to dart/18-Union-Find/UnionFind2.dart
diff --git a/18-Union-Find/UnionFind3.dart b/dart/18-Union-Find/UnionFind3.dart
similarity index 100%
rename from 18-Union-Find/UnionFind3.dart
rename to dart/18-Union-Find/UnionFind3.dart
diff --git a/18-Union-Find/UnionFind4.dart b/dart/18-Union-Find/UnionFind4.dart
similarity index 100%
rename from 18-Union-Find/UnionFind4.dart
rename to dart/18-Union-Find/UnionFind4.dart
diff --git a/18-Union-Find/UnionFind5.dart b/dart/18-Union-Find/UnionFind5.dart
similarity index 100%
rename from 18-Union-Find/UnionFind5.dart
rename to dart/18-Union-Find/UnionFind5.dart
diff --git a/18-Union-Find/UnionFind6.dart b/dart/18-Union-Find/UnionFind6.dart
similarity index 100%
rename from 18-Union-Find/UnionFind6.dart
rename to dart/18-Union-Find/UnionFind6.dart
diff --git a/19-AVL-Tree/AVLTree.dart b/dart/19-AVL-Tree/AVLTree.dart
similarity index 100%
rename from 19-AVL-Tree/AVLTree.dart
rename to dart/19-AVL-Tree/AVLTree.dart
diff --git a/19-AVL-Tree/BST.dart b/dart/19-AVL-Tree/BST.dart
similarity index 100%
rename from 19-AVL-Tree/BST.dart
rename to dart/19-AVL-Tree/BST.dart
diff --git a/19-AVL-Tree/FileOperator.dart b/dart/19-AVL-Tree/FileOperator.dart
similarity index 100%
rename from 19-AVL-Tree/FileOperator.dart
rename to dart/19-AVL-Tree/FileOperator.dart
diff --git a/19-AVL-Tree/Main.dart b/dart/19-AVL-Tree/Main.dart
similarity index 100%
rename from 19-AVL-Tree/Main.dart
rename to dart/19-AVL-Tree/Main.dart
diff --git a/19-AVL-Tree/text1.txt b/dart/19-AVL-Tree/text1.txt
similarity index 100%
rename from 19-AVL-Tree/text1.txt
rename to dart/19-AVL-Tree/text1.txt
diff --git a/19-AVL-Tree/text2.txt b/dart/19-AVL-Tree/text2.txt
similarity index 100%
rename from 19-AVL-Tree/text2.txt
rename to dart/19-AVL-Tree/text2.txt
diff --git a/20-Red-Black-Tree/AVLTree.dart b/dart/20-Red-Black-Tree/AVLTree.dart
similarity index 100%
rename from 20-Red-Black-Tree/AVLTree.dart
rename to dart/20-Red-Black-Tree/AVLTree.dart
diff --git a/20-Red-Black-Tree/BST.dart b/dart/20-Red-Black-Tree/BST.dart
similarity index 100%
rename from 20-Red-Black-Tree/BST.dart
rename to dart/20-Red-Black-Tree/BST.dart
diff --git a/20-Red-Black-Tree/FileOperator.dart b/dart/20-Red-Black-Tree/FileOperator.dart
similarity index 100%
rename from 20-Red-Black-Tree/FileOperator.dart
rename to dart/20-Red-Black-Tree/FileOperator.dart
diff --git a/20-Red-Black-Tree/Main.dart b/dart/20-Red-Black-Tree/Main.dart
similarity index 100%
rename from 20-Red-Black-Tree/Main.dart
rename to dart/20-Red-Black-Tree/Main.dart
diff --git a/20-Red-Black-Tree/Main2.dart b/dart/20-Red-Black-Tree/Main2.dart
similarity index 100%
rename from 20-Red-Black-Tree/Main2.dart
rename to dart/20-Red-Black-Tree/Main2.dart
diff --git a/20-Red-Black-Tree/RBTree.dart b/dart/20-Red-Black-Tree/RBTree.dart
similarity index 100%
rename from 20-Red-Black-Tree/RBTree.dart
rename to dart/20-Red-Black-Tree/RBTree.dart
diff --git a/20-Red-Black-Tree/text1.txt b/dart/20-Red-Black-Tree/text1.txt
similarity index 100%
rename from 20-Red-Black-Tree/text1.txt
rename to dart/20-Red-Black-Tree/text1.txt
diff --git a/20-Red-Black-Tree/text2.txt b/dart/20-Red-Black-Tree/text2.txt
similarity index 100%
rename from 20-Red-Black-Tree/text2.txt
rename to dart/20-Red-Black-Tree/text2.txt
diff --git a/21-Hash-Table/AVLTree.dart b/dart/21-Hash-Table/AVLTree.dart
similarity index 100%
rename from 21-Hash-Table/AVLTree.dart
rename to dart/21-Hash-Table/AVLTree.dart
diff --git a/21-Hash-Table/BST.dart b/dart/21-Hash-Table/BST.dart
similarity index 100%
rename from 21-Hash-Table/BST.dart
rename to dart/21-Hash-Table/BST.dart
diff --git a/21-Hash-Table/FileOperator.dart b/dart/21-Hash-Table/FileOperator.dart
similarity index 100%
rename from 21-Hash-Table/FileOperator.dart
rename to dart/21-Hash-Table/FileOperator.dart
diff --git a/21-Hash-Table/HashTable.dart b/dart/21-Hash-Table/HashTable.dart
similarity index 100%
rename from 21-Hash-Table/HashTable.dart
rename to dart/21-Hash-Table/HashTable.dart
diff --git a/21-Hash-Table/HashTableSec.dart b/dart/21-Hash-Table/HashTableSec.dart
similarity index 100%
rename from 21-Hash-Table/HashTableSec.dart
rename to dart/21-Hash-Table/HashTableSec.dart
diff --git a/21-Hash-Table/Main.dart b/dart/21-Hash-Table/Main.dart
similarity index 100%
rename from 21-Hash-Table/Main.dart
rename to dart/21-Hash-Table/Main.dart
diff --git a/21-Hash-Table/RBTree.dart b/dart/21-Hash-Table/RBTree.dart
similarity index 100%
rename from 21-Hash-Table/RBTree.dart
rename to dart/21-Hash-Table/RBTree.dart
diff --git a/21-Hash-Table/Solution.dart b/dart/21-Hash-Table/Solution.dart
similarity index 100%
rename from 21-Hash-Table/Solution.dart
rename to dart/21-Hash-Table/Solution.dart
diff --git a/21-Hash-Table/text1.txt b/dart/21-Hash-Table/text1.txt
similarity index 100%
rename from 21-Hash-Table/text1.txt
rename to dart/21-Hash-Table/text1.txt
diff --git a/21-Hash-Table/text2.txt b/dart/21-Hash-Table/text2.txt
similarity index 100%
rename from 21-Hash-Table/text2.txt
rename to dart/21-Hash-Table/text2.txt
diff --git a/22-CountingSort-And-RadixSort/ArrayGenerator.dart b/dart/22-CountingSort-And-RadixSort/ArrayGenerator.dart
similarity index 100%
rename from 22-CountingSort-And-RadixSort/ArrayGenerator.dart
rename to dart/22-CountingSort-And-RadixSort/ArrayGenerator.dart
diff --git a/22-CountingSort-And-RadixSort/LSDSort.dart b/dart/22-CountingSort-And-RadixSort/LSDSort.dart
similarity index 100%
rename from 22-CountingSort-And-RadixSort/LSDSort.dart
rename to dart/22-CountingSort-And-RadixSort/LSDSort.dart
diff --git a/22-CountingSort-And-RadixSort/Main.dart b/dart/22-CountingSort-And-RadixSort/Main.dart
similarity index 100%
rename from 22-CountingSort-And-RadixSort/Main.dart
rename to dart/22-CountingSort-And-RadixSort/Main.dart
diff --git a/22-CountingSort-And-RadixSort/ShellSort.dart b/dart/22-CountingSort-And-RadixSort/ShellSort.dart
similarity index 100%
rename from 22-CountingSort-And-RadixSort/ShellSort.dart
rename to dart/22-CountingSort-And-RadixSort/ShellSort.dart
diff --git a/22-CountingSort-And-RadixSort/Solution.dart b/dart/22-CountingSort-And-RadixSort/Solution.dart
similarity index 100%
rename from 22-CountingSort-And-RadixSort/Solution.dart
rename to dart/22-CountingSort-And-RadixSort/Solution.dart
diff --git a/22-CountingSort-And-RadixSort/SortingHelper.dart b/dart/22-CountingSort-And-RadixSort/SortingHelper.dart
similarity index 100%
rename from 22-CountingSort-And-RadixSort/SortingHelper.dart
rename to dart/22-CountingSort-And-RadixSort/SortingHelper.dart
diff --git a/22-CountingSort-And-RadixSort/Student.dart b/dart/22-CountingSort-And-RadixSort/Student.dart
similarity index 100%
rename from 22-CountingSort-And-RadixSort/Student.dart
rename to dart/22-CountingSort-And-RadixSort/Student.dart
diff --git a/23-MSDSort-And-BucketSort/ArrayGenerator.dart b/dart/23-MSDSort-And-BucketSort/ArrayGenerator.dart
similarity index 100%
rename from 23-MSDSort-And-BucketSort/ArrayGenerator.dart
rename to dart/23-MSDSort-And-BucketSort/ArrayGenerator.dart
diff --git a/23-MSDSort-And-BucketSort/BucketSort.dart b/dart/23-MSDSort-And-BucketSort/BucketSort.dart
similarity index 100%
rename from 23-MSDSort-And-BucketSort/BucketSort.dart
rename to dart/23-MSDSort-And-BucketSort/BucketSort.dart
diff --git a/23-MSDSort-And-BucketSort/MSDSort.dart b/dart/23-MSDSort-And-BucketSort/MSDSort.dart
similarity index 100%
rename from 23-MSDSort-And-BucketSort/MSDSort.dart
rename to dart/23-MSDSort-And-BucketSort/MSDSort.dart
diff --git a/23-MSDSort-And-BucketSort/MergeSort.dart b/dart/23-MSDSort-And-BucketSort/MergeSort.dart
similarity index 100%
rename from 23-MSDSort-And-BucketSort/MergeSort.dart
rename to dart/23-MSDSort-And-BucketSort/MergeSort.dart
diff --git a/23-MSDSort-And-BucketSort/ShellSort.dart b/dart/23-MSDSort-And-BucketSort/ShellSort.dart
similarity index 100%
rename from 23-MSDSort-And-BucketSort/ShellSort.dart
rename to dart/23-MSDSort-And-BucketSort/ShellSort.dart
diff --git a/23-MSDSort-And-BucketSort/SortingHelper.dart b/dart/23-MSDSort-And-BucketSort/SortingHelper.dart
similarity index 100%
rename from 23-MSDSort-And-BucketSort/SortingHelper.dart
rename to dart/23-MSDSort-And-BucketSort/SortingHelper.dart
diff --git a/24-SubString-Match/FileOperator.dart b/dart/24-SubString-Match/FileOperator.dart
similarity index 100%
rename from 24-SubString-Match/FileOperator.dart
rename to dart/24-SubString-Match/FileOperator.dart
diff --git a/24-SubString-Match/LC1392-hash.dart b/dart/24-SubString-Match/LC1392-hash.dart
similarity index 100%
rename from 24-SubString-Match/LC1392-hash.dart
rename to dart/24-SubString-Match/LC1392-hash.dart
diff --git a/24-SubString-Match/LC1392.dart b/dart/24-SubString-Match/LC1392.dart
similarity index 100%
rename from 24-SubString-Match/LC1392.dart
rename to dart/24-SubString-Match/LC1392.dart
diff --git a/24-SubString-Match/LC187-RollingHash.dart b/dart/24-SubString-Match/LC187-RollingHash.dart
similarity index 100%
rename from 24-SubString-Match/LC187-RollingHash.dart
rename to dart/24-SubString-Match/LC187-RollingHash.dart
diff --git a/24-SubString-Match/LC187.dart b/dart/24-SubString-Match/LC187.dart
similarity index 100%
rename from 24-SubString-Match/LC187.dart
rename to dart/24-SubString-Match/LC187.dart
diff --git a/24-SubString-Match/Solution.dart b/dart/24-SubString-Match/Solution.dart
similarity index 100%
rename from 24-SubString-Match/Solution.dart
rename to dart/24-SubString-Match/Solution.dart
diff --git a/24-SubString-Match/Solution2.dart b/dart/24-SubString-Match/Solution2.dart
similarity index 100%
rename from 24-SubString-Match/Solution2.dart
rename to dart/24-SubString-Match/Solution2.dart
diff --git a/24-SubString-Match/SubstringMatch.dart b/dart/24-SubString-Match/SubstringMatch.dart
similarity index 100%
rename from 24-SubString-Match/SubstringMatch.dart
rename to dart/24-SubString-Match/SubstringMatch.dart
diff --git a/24-SubString-Match/SubstringMatchHelper.dart b/dart/24-SubString-Match/SubstringMatchHelper.dart
similarity index 100%
rename from 24-SubString-Match/SubstringMatchHelper.dart
rename to dart/24-SubString-Match/SubstringMatchHelper.dart
diff --git a/24-SubString-Match/text1.txt b/dart/24-SubString-Match/text1.txt
similarity index 100%
rename from 24-SubString-Match/text1.txt
rename to dart/24-SubString-Match/text1.txt
diff --git a/24-SubString-Match/text2.txt b/dart/24-SubString-Match/text2.txt
similarity index 100%
rename from 24-SubString-Match/text2.txt
rename to dart/24-SubString-Match/text2.txt
diff --git a/25-GraphBascis/AdjList.dart b/dart/25-GraphBascis/AdjList.dart
similarity index 100%
rename from 25-GraphBascis/AdjList.dart
rename to dart/25-GraphBascis/AdjList.dart
diff --git a/25-GraphBascis/AdjMatrix.dart b/dart/25-GraphBascis/AdjMatrix.dart
similarity index 100%
rename from 25-GraphBascis/AdjMatrix.dart
rename to dart/25-GraphBascis/AdjMatrix.dart
diff --git a/25-GraphBascis/AdjSet.dart b/dart/25-GraphBascis/AdjSet.dart
similarity index 100%
rename from 25-GraphBascis/AdjSet.dart
rename to dart/25-GraphBascis/AdjSet.dart
diff --git a/25-GraphBascis/FileOperator.dart b/dart/25-GraphBascis/FileOperator.dart
similarity index 100%
rename from 25-GraphBascis/FileOperator.dart
rename to dart/25-GraphBascis/FileOperator.dart
diff --git a/25-GraphBascis/Graph.dart b/dart/25-GraphBascis/Graph.dart
similarity index 100%
rename from 25-GraphBascis/Graph.dart
rename to dart/25-GraphBascis/Graph.dart
diff --git a/25-GraphBascis/ListItem.dart b/dart/25-GraphBascis/ListItem.dart
similarity index 100%
rename from 25-GraphBascis/ListItem.dart
rename to dart/25-GraphBascis/ListItem.dart
diff --git a/25-GraphBascis/g.txt b/dart/25-GraphBascis/g.txt
similarity index 100%
rename from 25-GraphBascis/g.txt
rename to dart/25-GraphBascis/g.txt
diff --git a/26-GraphDFS/AdjMatrix.dart b/dart/26-GraphDFS/AdjMatrix.dart
similarity index 100%
rename from 26-GraphDFS/AdjMatrix.dart
rename to dart/26-GraphDFS/AdjMatrix.dart
diff --git a/26-GraphDFS/AdjMatrixDFS.dart b/dart/26-GraphDFS/AdjMatrixDFS.dart
similarity index 100%
rename from 26-GraphDFS/AdjMatrixDFS.dart
rename to dart/26-GraphDFS/AdjMatrixDFS.dart
diff --git a/26-GraphDFS/ArrayStack.dart b/dart/26-GraphDFS/ArrayStack.dart
similarity index 100%
rename from 26-GraphDFS/ArrayStack.dart
rename to dart/26-GraphDFS/ArrayStack.dart
diff --git a/26-GraphDFS/Graph.dart b/dart/26-GraphDFS/Graph.dart
similarity index 100%
rename from 26-GraphDFS/Graph.dart
rename to dart/26-GraphDFS/Graph.dart
diff --git a/26-GraphDFS/GraphDFS.dart b/dart/26-GraphDFS/GraphDFS.dart
similarity index 100%
rename from 26-GraphDFS/GraphDFS.dart
rename to dart/26-GraphDFS/GraphDFS.dart
diff --git a/26-GraphDFS/GraphDFSnr.dart b/dart/26-GraphDFS/GraphDFSnr.dart
similarity index 100%
rename from 26-GraphDFS/GraphDFSnr.dart
rename to dart/26-GraphDFS/GraphDFSnr.dart
diff --git a/26-GraphDFS/Stack.dart b/dart/26-GraphDFS/Stack.dart
similarity index 100%
rename from 26-GraphDFS/Stack.dart
rename to dart/26-GraphDFS/Stack.dart
diff --git a/26-GraphDFS/g.txt b/dart/26-GraphDFS/g.txt
similarity index 100%
rename from 26-GraphDFS/g.txt
rename to dart/26-GraphDFS/g.txt
diff --git a/27-GraphDFS-Application/BipartitionDetection.dart b/dart/27-GraphDFS-Application/BipartitionDetection.dart
similarity index 100%
rename from 27-GraphDFS-Application/BipartitionDetection.dart
rename to dart/27-GraphDFS-Application/BipartitionDetection.dart
diff --git a/27-GraphDFS-Application/CC.dart b/dart/27-GraphDFS-Application/CC.dart
similarity index 100%
rename from 27-GraphDFS-Application/CC.dart
rename to dart/27-GraphDFS-Application/CC.dart
diff --git a/27-GraphDFS-Application/CycleDetection.dart b/dart/27-GraphDFS-Application/CycleDetection.dart
similarity index 100%
rename from 27-GraphDFS-Application/CycleDetection.dart
rename to dart/27-GraphDFS-Application/CycleDetection.dart
diff --git a/27-GraphDFS-Application/Graph.dart b/dart/27-GraphDFS-Application/Graph.dart
similarity index 100%
rename from 27-GraphDFS-Application/Graph.dart
rename to dart/27-GraphDFS-Application/Graph.dart
diff --git a/27-GraphDFS-Application/GraphDFS.dart b/dart/27-GraphDFS-Application/GraphDFS.dart
similarity index 100%
rename from 27-GraphDFS-Application/GraphDFS.dart
rename to dart/27-GraphDFS-Application/GraphDFS.dart
diff --git a/27-GraphDFS-Application/SingleSourcePath.dart b/dart/27-GraphDFS-Application/SingleSourcePath.dart
similarity index 100%
rename from 27-GraphDFS-Application/SingleSourcePath.dart
rename to dart/27-GraphDFS-Application/SingleSourcePath.dart
diff --git a/27-GraphDFS-Application/g.txt b/dart/27-GraphDFS-Application/g.txt
similarity index 100%
rename from 27-GraphDFS-Application/g.txt
rename to dart/27-GraphDFS-Application/g.txt
diff --git a/27-GraphDFS-Application/g2.txt b/dart/27-GraphDFS-Application/g2.txt
similarity index 100%
rename from 27-GraphDFS-Application/g2.txt
rename to dart/27-GraphDFS-Application/g2.txt
diff --git a/27-GraphDFS-Application/g3.txt b/dart/27-GraphDFS-Application/g3.txt
similarity index 100%
rename from 27-GraphDFS-Application/g3.txt
rename to dart/27-GraphDFS-Application/g3.txt
diff --git a/28-Graph-BFS/BipartitionDetection.dart b/dart/28-Graph-BFS/BipartitionDetection.dart
similarity index 100%
rename from 28-Graph-BFS/BipartitionDetection.dart
rename to dart/28-Graph-BFS/BipartitionDetection.dart
diff --git a/28-Graph-BFS/CC.dart b/dart/28-Graph-BFS/CC.dart
similarity index 100%
rename from 28-Graph-BFS/CC.dart
rename to dart/28-Graph-BFS/CC.dart
diff --git a/28-Graph-BFS/CycleDetection.dart b/dart/28-Graph-BFS/CycleDetection.dart
similarity index 100%
rename from 28-Graph-BFS/CycleDetection.dart
rename to dart/28-Graph-BFS/CycleDetection.dart
diff --git a/28-Graph-BFS/Graph.dart b/dart/28-Graph-BFS/Graph.dart
similarity index 100%
rename from 28-Graph-BFS/Graph.dart
rename to dart/28-Graph-BFS/Graph.dart
diff --git a/28-Graph-BFS/GraphBFS.dart b/dart/28-Graph-BFS/GraphBFS.dart
similarity index 100%
rename from 28-Graph-BFS/GraphBFS.dart
rename to dart/28-Graph-BFS/GraphBFS.dart
diff --git a/28-Graph-BFS/SingleSourcePath.dart b/dart/28-Graph-BFS/SingleSourcePath.dart
similarity index 100%
rename from 28-Graph-BFS/SingleSourcePath.dart
rename to dart/28-Graph-BFS/SingleSourcePath.dart
diff --git a/28-Graph-BFS/g.txt b/dart/28-Graph-BFS/g.txt
similarity index 100%
rename from 28-Graph-BFS/g.txt
rename to dart/28-Graph-BFS/g.txt
diff --git a/28-Graph-BFS/g2.txt b/dart/28-Graph-BFS/g2.txt
similarity index 100%
rename from 28-Graph-BFS/g2.txt
rename to dart/28-Graph-BFS/g2.txt
diff --git a/28-Graph-BFS/g3.txt b/dart/28-Graph-BFS/g3.txt
similarity index 100%
rename from 28-Graph-BFS/g3.txt
rename to dart/28-Graph-BFS/g3.txt
diff --git a/29-Brigde-And-Cut-Points/Edge.dart b/dart/29-Brigde-And-Cut-Points/Edge.dart
similarity index 100%
rename from 29-Brigde-And-Cut-Points/Edge.dart
rename to dart/29-Brigde-And-Cut-Points/Edge.dart
diff --git a/29-Brigde-And-Cut-Points/FindBridges.dart b/dart/29-Brigde-And-Cut-Points/FindBridges.dart
similarity index 100%
rename from 29-Brigde-And-Cut-Points/FindBridges.dart
rename to dart/29-Brigde-And-Cut-Points/FindBridges.dart
diff --git a/29-Brigde-And-Cut-Points/FindCutPoints.dart b/dart/29-Brigde-And-Cut-Points/FindCutPoints.dart
similarity index 100%
rename from 29-Brigde-And-Cut-Points/FindCutPoints.dart
rename to dart/29-Brigde-And-Cut-Points/FindCutPoints.dart
diff --git a/29-Brigde-And-Cut-Points/Graph.dart b/dart/29-Brigde-And-Cut-Points/Graph.dart
similarity index 100%
rename from 29-Brigde-And-Cut-Points/Graph.dart
rename to dart/29-Brigde-And-Cut-Points/Graph.dart
diff --git a/29-Brigde-And-Cut-Points/g.txt b/dart/29-Brigde-And-Cut-Points/g.txt
similarity index 100%
rename from 29-Brigde-And-Cut-Points/g.txt
rename to dart/29-Brigde-And-Cut-Points/g.txt
diff --git a/29-Brigde-And-Cut-Points/g2.txt b/dart/29-Brigde-And-Cut-Points/g2.txt
similarity index 100%
rename from 29-Brigde-And-Cut-Points/g2.txt
rename to dart/29-Brigde-And-Cut-Points/g2.txt
diff --git a/29-Brigde-And-Cut-Points/g3.txt b/dart/29-Brigde-And-Cut-Points/g3.txt
similarity index 100%
rename from 29-Brigde-And-Cut-Points/g3.txt
rename to dart/29-Brigde-And-Cut-Points/g3.txt
diff --git a/29-Brigde-And-Cut-Points/g4.txt b/dart/29-Brigde-And-Cut-Points/g4.txt
similarity index 100%
rename from 29-Brigde-And-Cut-Points/g4.txt
rename to dart/29-Brigde-And-Cut-Points/g4.txt
diff --git a/29-Brigde-And-Cut-Points/tree.txt b/dart/29-Brigde-And-Cut-Points/tree.txt
similarity index 100%
rename from 29-Brigde-And-Cut-Points/tree.txt
rename to dart/29-Brigde-And-Cut-Points/tree.txt
diff --git a/30-Minimum-Tree-Spanning/CC.dart b/dart/30-Minimum-Tree-Spanning/CC.dart
similarity index 100%
rename from 30-Minimum-Tree-Spanning/CC.dart
rename to dart/30-Minimum-Tree-Spanning/CC.dart
diff --git a/30-Minimum-Tree-Spanning/Edge.dart b/dart/30-Minimum-Tree-Spanning/Edge.dart
similarity index 100%
rename from 30-Minimum-Tree-Spanning/Edge.dart
rename to dart/30-Minimum-Tree-Spanning/Edge.dart
diff --git a/30-Minimum-Tree-Spanning/Graph.dart b/dart/30-Minimum-Tree-Spanning/Graph.dart
similarity index 100%
rename from 30-Minimum-Tree-Spanning/Graph.dart
rename to dart/30-Minimum-Tree-Spanning/Graph.dart
diff --git a/30-Minimum-Tree-Spanning/Kruskal.dart b/dart/30-Minimum-Tree-Spanning/Kruskal.dart
similarity index 100%
rename from 30-Minimum-Tree-Spanning/Kruskal.dart
rename to dart/30-Minimum-Tree-Spanning/Kruskal.dart
diff --git a/30-Minimum-Tree-Spanning/Prim.dart b/dart/30-Minimum-Tree-Spanning/Prim.dart
similarity index 100%
rename from 30-Minimum-Tree-Spanning/Prim.dart
rename to dart/30-Minimum-Tree-Spanning/Prim.dart
diff --git a/30-Minimum-Tree-Spanning/UF.dart b/dart/30-Minimum-Tree-Spanning/UF.dart
similarity index 100%
rename from 30-Minimum-Tree-Spanning/UF.dart
rename to dart/30-Minimum-Tree-Spanning/UF.dart
diff --git a/30-Minimum-Tree-Spanning/WeightedEdge.dart b/dart/30-Minimum-Tree-Spanning/WeightedEdge.dart
similarity index 100%
rename from 30-Minimum-Tree-Spanning/WeightedEdge.dart
rename to dart/30-Minimum-Tree-Spanning/WeightedEdge.dart
diff --git a/30-Minimum-Tree-Spanning/WeightedGraph.dart b/dart/30-Minimum-Tree-Spanning/WeightedGraph.dart
similarity index 100%
rename from 30-Minimum-Tree-Spanning/WeightedGraph.dart
rename to dart/30-Minimum-Tree-Spanning/WeightedGraph.dart
diff --git a/30-Minimum-Tree-Spanning/g.txt b/dart/30-Minimum-Tree-Spanning/g.txt
similarity index 100%
rename from 30-Minimum-Tree-Spanning/g.txt
rename to dart/30-Minimum-Tree-Spanning/g.txt
diff --git a/Dart-Basic.iml b/dart/Dart-Basic.iml
similarity index 100%
rename from Dart-Basic.iml
rename to dart/Dart-Basic.iml
diff --git a/python/sort.py b/python/sort.py
new file mode 100644
index 0000000..4d12b2e
--- /dev/null
+++ b/python/sort.py
@@ -0,0 +1,52 @@
+'''
+    线性查找
+    冒泡排序
+    选择排序
+    插入排序
+    希尔排序
+'''
+import random
+# 线性查找算法
+def liner_search(list,value):
+    for item in range(len(list)):
+        if(list[item] == value):
+            return item;
+    return -1;    
+print("---------------------线性查找");
+testList = [1,2,3,4,5,6,7,8,9]
+print(liner_search(testList, 8))
+
+# 选择排序
+def selectionSort(sortList):
+  print(sortList);
+  for i in range(len(sortList)):
+      minIndex = i ;
+      for j in range(i,len(sortList)):
+          if sortList[minIndex]>sortList[j]:
+              minIndex=j
+      sortList[i],sortList[minIndex] = sortList[minIndex],sortList[i]
+  return sortList
+print("---------------------选择排序");
+random.seed(54)
+sortList = [random.randint(0,100) for _ in range(10)]
+print("原始数据：", sortList)
+selectionSort(sortList)
+print("选择排序结果：", sortList)
+
+
+ # 冒泡排序
+def bubble_sort(sortList):
+      for i in range(len(sortList)):
+          isSwap = False; #设置标志位，若已排序好，则不排序
+          for j in range(len(sortList)-i-1):
+              if sortList[j] > sortList[j + 1]:
+                    sortList[j], sortList[j + 1] = sortList[j + 1], sortList[j]
+                    isSwap = True
+          if not isSwap:
+            break
+print("---------------------冒泡排序");
+random.seed(54)
+sortList = [random.randint(0,100) for _ in range(10)]
+print("原始数据：", sortList)
+bubble_sort(sortList)
+print("冒泡排序结果：", sortList)

From 9660640b4df5114782b2cfbf5774257d334808af Mon Sep 17 00:00:00 2001
From: "tianqing.liang" <1>
Date: Fri, 18 Mar 2022 15:08:32 +0800
Subject: [PATCH 14/21] =?UTF-8?q?=E6=8E=92=E5=BA=8F=E7=AE=97=E6=B3=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 README.md                              |  10 +--
 python/__pycache__/sort.cpython-37.pyc | Bin 0 -> 2739 bytes
 python/multiSort.py                    |  89 +++++++++++++++++++++++++
 python/sort.py                         |  52 ---------------
 4 files changed, 94 insertions(+), 57 deletions(-)
 create mode 100644 python/__pycache__/sort.cpython-37.pyc
 create mode 100644 python/multiSort.py
 delete mode 100644 python/sort.py

diff --git a/README.md b/README.md
index ab49ed8..36f7617 100644
--- a/README.md
+++ b/README.md
@@ -2,9 +2,9 @@
 
 <h3>使用Flutter的Dart语言重写数据结构与算法</h3>
 
-1. 线性搜索
-2. 选择排序
-3. 插入排序
+1. [Dart,Python]线性搜索
+2. [Dart,Python]选择排序
+3. [Dart,Python]插入排序
 4. 栈，队列，循环队列
 5. 链表，链表实现栈，链表实现队列
 6. 递归
@@ -15,8 +15,8 @@
 11. 集合 和 映射
 12. 堆
 13. 优先队列
-14. 冒泡排序
-15. 希尔排序
+14. [Dart,Python]冒泡排序
+15. [Dart,Python]希尔排序
 16. 线段树
 17. Trie字典树
 18. 并查集
diff --git a/python/__pycache__/sort.cpython-37.pyc b/python/__pycache__/sort.cpython-37.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..cfe173660538f640fa0e0e9416b8930aa977e749
GIT binary patch
diff --git a/python/multiSort.py b/python/multiSort.py
new file mode 100644
index 0000000..888e089
--- /dev/null
+++ b/python/multiSort.py
@@ -0,0 +1,89 @@
+'''
+    线性查找
+    冒泡排序
+    选择排序
+    插入排序
+    希尔排序
+'''
+import random
+import time
+# 线性查找算法
+def liner_search(list,value):
+    for item in range(len(list)):
+        if(list[item] == value):
+            return item;
+    return -1;    
+print("---------------------线性查找");
+testList = [1,2,3,4,5,6,7,8,9]
+start = time.perf_counter()
+print(liner_search(testList, 8))
+end = time.perf_counter()
+print("时间：", end-start)
+
+# 选择排序
+def selectionSort(sortList):
+  for i in range(len(sortList)):
+      minIndex = i ;
+      for j in range(i,len(sortList)):
+          if sortList[minIndex]>sortList[j]:
+              minIndex=j
+      sortList[i],sortList[minIndex] = sortList[minIndex],sortList[i]
+  return sortList
+
+
+ # 冒泡排序
+def bubble_sort(sortList):
+      for i in range(len(sortList)):
+          isSwap = False; #设置标志位，若已排序好，则不排序
+          for j in range(len(sortList)-i-1):
+              if sortList[j] > sortList[j + 1]:
+                    sortList[j], sortList[j + 1] = sortList[j + 1], sortList[j]
+                    isSwap = True
+          if not isSwap:
+            break
+
+# 插入排序
+def insertionSort(sortList):
+    for i in range(1,len(sortList)):
+        currentValue = sortList[i]
+        currentPosition = i 
+        while currentPosition>0 and sortList[currentPosition-1]>currentValue:
+            sortList[currentPosition] = sortList[currentPosition-1]
+            currentPosition = currentPosition-1
+        sortList[currentPosition] = currentValue
+    return sortList
+
+#希尔排序
+def shellSort(sortList):
+    length = len(sortList)
+    dist = length // 2
+    
+    while dist > 0 :
+        for i in range(dist,length):
+            j = i 
+            while j >= dist and sortList[j-dist] > sortList[j] :
+                sortList[j-dist],sortList[j] = sortList[j],sortList[j-dist]
+                j = j- dist
+        dist = dist//2
+    return sortList
+# 计算结果，计算时间
+def caculateResultAndTime(name,fuction,randomseed):
+    print("--------------------",name)
+    random.seed(randomseed)
+    sortList = [random.randint(0,100) for _ in range(10)]
+    print("原始数据：",sortList)
+    startTime = time.perf_counter()
+    fuction(sortList)
+    endTime = time.perf_counter()
+    print("排序结果:",sortList,' 花费时间：',endTime-startTime)
+
+if __name__ == '__main__':
+    caculateResultAndTime("希尔排序",shellSort,88)
+    caculateResultAndTime("插入排序",insertionSort,89)
+    caculateResultAndTime("冒泡排序",bubble_sort,90)
+    caculateResultAndTime("选择排序",selectionSort,91)
+        
+    
+
+
+
diff --git a/python/sort.py b/python/sort.py
deleted file mode 100644
index 4d12b2e..0000000
--- a/python/sort.py
+++ /dev/null
@@ -1,52 +0,0 @@
-'''
-    线性查找
-    冒泡排序
-    选择排序
-    插入排序
-    希尔排序
-'''
-import random
-# 线性查找算法
-def liner_search(list,value):
-    for item in range(len(list)):
-        if(list[item] == value):
-            return item;
-    return -1;    
-print("---------------------线性查找");
-testList = [1,2,3,4,5,6,7,8,9]
-print(liner_search(testList, 8))
-
-# 选择排序
-def selectionSort(sortList):
-  print(sortList);
-  for i in range(len(sortList)):
-      minIndex = i ;
-      for j in range(i,len(sortList)):
-          if sortList[minIndex]>sortList[j]:
-              minIndex=j
-      sortList[i],sortList[minIndex] = sortList[minIndex],sortList[i]
-  return sortList
-print("---------------------选择排序");
-random.seed(54)
-sortList = [random.randint(0,100) for _ in range(10)]
-print("原始数据：", sortList)
-selectionSort(sortList)
-print("选择排序结果：", sortList)
-
-
- # 冒泡排序
-def bubble_sort(sortList):
-      for i in range(len(sortList)):
-          isSwap = False; #设置标志位，若已排序好，则不排序
-          for j in range(len(sortList)-i-1):
-              if sortList[j] > sortList[j + 1]:
-                    sortList[j], sortList[j + 1] = sortList[j + 1], sortList[j]
-                    isSwap = True
-          if not isSwap:
-            break
-print("---------------------冒泡排序");
-random.seed(54)
-sortList = [random.randint(0,100) for _ in range(10)]
-print("原始数据：", sortList)
-bubble_sort(sortList)
-print("冒泡排序结果：", sortList)

From 1951c8b989052296e6cd1c04ef20f03f0dc0a844 Mon Sep 17 00:00:00 2001
From: "tianqing.liang" <1>
Date: Mon, 21 Mar 2022 16:21:19 +0800
Subject: [PATCH 15/21] Stack Queue LoopQueue

---
 README.md                          | 12 +++---
 dart/04-Stack-Queue/LoopQueue.dart | 48 ++++++++++-------------
 dart/04-Stack-Queue/Main.dart      |  9 +++--
 python/loopqueue.py                | 62 ++++++++++++++++++++++++++++++
 python/queue.py                    | 44 +++++++++++++++++++++
 python/stack.py                    | 44 +++++++++++++++++++++
 6 files changed, 182 insertions(+), 37 deletions(-)
 create mode 100644 python/loopqueue.py
 create mode 100644 python/queue.py
 create mode 100644 python/stack.py

diff --git a/README.md b/README.md
index 36f7617..b2600da 100644
--- a/README.md
+++ b/README.md
@@ -2,10 +2,10 @@
 
 <h3>使用Flutter的Dart语言重写数据结构与算法</h3>
 
-1. [Dart,Python]线性搜索
-2. [Dart,Python]选择排序
-3. [Dart,Python]插入排序
-4. 栈，队列，循环队列
+1. **[Dart,Python]线性搜索**
+2. **[Dart,Python]选择排序**
+3. **[Dart,Python]插入排序**
+4. **[Dart,Python]栈，队列，循环队列**
 5. 链表，链表实现栈，链表实现队列
 6. 递归
 7. 归并排序
@@ -15,8 +15,8 @@
 11. 集合 和 映射
 12. 堆
 13. 优先队列
-14. [Dart,Python]冒泡排序
-15. [Dart,Python]希尔排序
+14. **[Dart,Python]冒泡排序**
+15. **[Dart,Python]希尔排序**
 16. 线段树
 17. Trie字典树
 18. 并查集
diff --git a/dart/04-Stack-Queue/LoopQueue.dart b/dart/04-Stack-Queue/LoopQueue.dart
index 81686af..17d04c1 100644
--- a/dart/04-Stack-Queue/LoopQueue.dart
+++ b/dart/04-Stack-Queue/LoopQueue.dart
@@ -1,44 +1,42 @@
 import 'Queue.dart';
 
-class LoopQueue<T> implements Queue<T>{
-
+class LoopQueue<T> implements Queue<T> {
   List? arr;
-  int front = 0,tail=0;
-  int size =0;
+  int front = 0, tail = 0;
+  int size = 0;
 
-  LoopQueue(){
+  LoopQueue() {
     arr = List.filled(10, false);
   }
 
-  LoopQueue.capcity(int capacity){
-    arr = List.filled(capacity+1, false);
-  }
+  // LoopQueue.capcity(int capacity){
+  //   arr = List.filled(capacity+1, false);
+  // }
 
-  int getCapacity(){
+  int getCapacity() {
     //目前这种方式浪费一个空间
-    int capacity =  arr!.length-1;
+    int capacity = arr!.length - 1;
     return capacity;
   }
 
   @override
   dequeue() {
-    if(isEmpty()){
+    if (isEmpty()) {
       throw Exception("Cannot dequeue from an empty queue");
     }
     T ret = arr![front];
     arr![front] = null;
     front = (front + 1) % arr!.length;
     size--;
-    if(size == getCapacity() / 4 && getCapacity() / 2 != 0){
-      resize((getCapacity()/2) as int);
+    if (size == getCapacity() / 4 && getCapacity() / 2 != 0) {
+      resize((getCapacity() / 2) as int);
     }
     return ret;
   }
 
-  void resize(int newCapacity){
-
-    List? newArr = List.filled(newCapacity+1, false);
-    for(int i = 0 ; i < arr!.length ; i ++){
+  void resize(int newCapacity) {
+    List? newArr = List.filled(newCapacity + 1, false);
+    for (int i = 0; i < arr!.length; i++) {
       newArr[i] = arr![(i + front) % arr!.length];
     }
     arr = newArr;
@@ -48,9 +46,7 @@ class LoopQueue<T> implements Queue<T>{
 
   @override
   void enqueue(e) {
-
-    if((tail + 1) % arr!.length == front)
-      resize(getCapacity() * 2);
+    if ((tail + 1) % arr!.length == front) resize(getCapacity() * 2);
     arr![tail] = e;
     tail = (tail + 1) % arr!.length;
     size++;
@@ -58,7 +54,7 @@ class LoopQueue<T> implements Queue<T>{
 
   @override
   getFront() {
-    if(isEmpty()){
+    if (isEmpty()) {
       throw Exception("Queue is empty.");
     }
     return arr![front];
@@ -71,7 +67,7 @@ class LoopQueue<T> implements Queue<T>{
 
   @override
   bool isEmpty() {
-    return front == tail ;
+    return front == tail;
   }
 
   @override
@@ -79,13 +75,11 @@ class LoopQueue<T> implements Queue<T>{
     StringBuffer buffer = new StringBuffer();
     buffer.write("Queue: size = $size , capacity = ${getCapacity()} \n");
     buffer.write('front [');
-    for(int i = front ; i != tail ; i = (i + 1) % arr!.length){
+    for (int i = front; i != tail; i = (i + 1) % arr!.length) {
       buffer.write(arr![i]);
-      if((i + 1) % arr!.length != tail)
-        buffer.write(", ");
+      if ((i + 1) % arr!.length != tail) buffer.write(", ");
     }
     buffer.write("] tail");
     return buffer.toString();
   }
-
-}
\ No newline at end of file
+}
diff --git a/dart/04-Stack-Queue/Main.dart b/dart/04-Stack-Queue/Main.dart
index fcf6281..1d376a9 100644
--- a/dart/04-Stack-Queue/Main.dart
+++ b/dart/04-Stack-Queue/Main.dart
@@ -2,7 +2,7 @@ import 'ArrayStack.dart';
 import 'ArrayQueue.dart';
 import 'LoopQueue.dart';
 
-void main(){
+void main() {
 //  ArrayStack<int> stack = new ArrayStack<int>();
 //  for(int i = 0 ; i < 10 ; i ++){
 //    stack.push(i);
@@ -22,13 +22,14 @@ void main(){
 //  }
 
   LoopQueue<int> loopQueue = new LoopQueue<int>();
-  for(int i = 0 ; i < 30 ; i ++){
+
+  for (int i = 0; i < 30; i++) {
     loopQueue.enqueue(i);
     print(loopQueue);
 
-    if(i % 3 == 2){
+    if (i % 3 == 2) {
       loopQueue.dequeue();
       print(loopQueue);
     }
   }
-}
\ No newline at end of file
+}
diff --git a/python/loopqueue.py b/python/loopqueue.py
new file mode 100644
index 0000000..f5e8eb2
--- /dev/null
+++ b/python/loopqueue.py
@@ -0,0 +1,62 @@
+class LoopQueue(object):
+
+    def __init__(self, n=10):
+        self.arr = [None] * (n)  
+        self.front = 0
+        self.tail = 0
+        self.size = 0
+
+    def getCapacity(self):
+        capacity = len(self.arr) - 1;
+        return capacity;
+
+    def dequeue(self):
+        if self.isEmpty() :
+            raise Exception("Cannot dequeue from an empty queue")
+        ret = self.arr[self.front]
+        self.arr[self.front] = None
+        self.front = (self.front + 1)%len(self.arr)
+        self.size -=1
+        if((self.size == self.getCapacity()//4)) and (self.getCapacity()/2 !=0):
+            resize(self.getCapacity()//2)
+        return ret
+
+    def resize(self,newCapacity):
+        newArr = [None]*(newCapacity+1)
+        for i in range(0,len(self.arr)):
+            newArr[i] = self.arr[(i+self.front)%len(self.arr)];
+        self.arr = newArr
+        self.front = 0;
+        self.tail = self.size;
+    
+    def enqueue(self,element):
+        print('当前大小:',self.size)
+        if ((self.tail+1)%len(self.arr)) == self.front:
+            self.resize(self.getCapacity()*2)
+        self.arr[self.tail] = element
+        self.tail = (self.tail +1)% len(self.arr)
+        self.size += 1
+        print('当前大小:',self.size)
+
+    def getFront(self):
+        if(self.isEmpty()):
+            raise Exception("Queue is empty.")        
+        return self.arr[self.front]
+
+    def getSize(self):
+        return len(self.arr)
+    
+    def isEmpty(self):
+        return self.front == self.tail
+        
+    def __str__(self):
+        return "front ["+" ".join(map(str, self.arr)) + "] tail"
+
+if __name__ == '__main__':
+    loopQueue = LoopQueue();
+    for i in range(0,30):
+        loopQueue.enqueue(i);
+        print(loopQueue)
+
+      
+      
\ No newline at end of file
diff --git a/python/queue.py b/python/queue.py
new file mode 100644
index 0000000..f150f99
--- /dev/null
+++ b/python/queue.py
@@ -0,0 +1,44 @@
+'''
+    队列
+'''
+class Queue(object):
+
+    # 初始化 
+    def __init__(self):
+        self.__list = []
+
+    #添加元素
+    def push(self,element):
+        self.__list.append(element)
+
+    # 弹出元素
+    def pop(self):
+       if self.isEmpty():
+           return None
+       else:
+           return self.__list.pop(0)
+
+    #是否为空
+    def isEmpty(self):
+        return len(self.__list) == 0
+    
+    def getSize(self):
+        return len(self.__list)
+    
+    def __str__(self):
+       return " ".join(map(str, self.__list))
+
+if __name__ == '__main__':
+    testQueue = Queue();
+    testQueue.push(1)
+    testQueue.push(2)
+    testQueue.push(3)
+    testQueue.push(4)
+    print(testQueue)  
+    testQueue.pop()
+    print(testQueue)  
+
+
+    
+        
+
diff --git a/python/stack.py b/python/stack.py
new file mode 100644
index 0000000..c3937ae
--- /dev/null
+++ b/python/stack.py
@@ -0,0 +1,44 @@
+'''
+    栈
+'''
+class Stack(object):
+
+    # 初始化 
+    def __init__(self):
+        self.__list = []
+
+    #添加元素
+    def push(self,element):
+        self.__list.append(element)
+
+    # 弹出元素
+    def pop(self):
+       if self.isEmpty():
+           return None
+       else:
+           return self.__list.pop()
+
+    #是否为空
+    def isEmpty(self):
+        return len(self.__list) == 0
+    
+    def getSize(self):
+        return len(self.__list)
+    
+    def __str__(self):
+       return " ".join(map(str, self.__list))
+
+if __name__ == '__main__':
+    testStack = Stack();
+    testStack.push(1)
+    testStack.push(2)
+    testStack.push(3)
+    testStack.push(4)
+    print(testStack)  
+    testStack.pop()
+    print(testStack)  
+
+
+    
+        
+

From 0028c74a652014961f3584856d1b95af5457f250 Mon Sep 17 00:00:00 2001
From: "tianqing.liang" <1>
Date: Wed, 23 Mar 2022 16:24:51 +0800
Subject: [PATCH 16/21] =?UTF-8?q?=E5=BD=92=E5=B9=B6=E6=8E=92=E5=BA=8F?=
 =?UTF-8?q?=EF=BC=8C=E5=BF=AB=E9=80=9F=E6=8E=92=E5=BA=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 README.md            |   5 +-
 python/linkedlist.py | 154 +++++++++++++++++++++++++++++++++++++++++++
 python/multiSort.py  |  59 ++++++++++++++++-
 3 files changed, 213 insertions(+), 5 deletions(-)
 create mode 100644 python/linkedlist.py

diff --git a/README.md b/README.md
index b2600da..3f6cc82 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,7 @@
 # AlgorithmAndDataArchitecture
 
-<h3>使用Flutter的Dart语言重写数据结构与算法</h3>
+<h3>使用Python、Flutter的Dart语言重写数据结构与算法</h3>
+
 
 1. **[Dart,Python]线性搜索**
 2. **[Dart,Python]选择排序**
@@ -9,7 +10,7 @@
 5. 链表，链表实现栈，链表实现队列
 6. 递归
 7. 归并排序
-8. 快速排序
+8. **[Dart,Python]快速排序**
 9. 二分搜索
 10. 二分搜索树
 11. 集合 和 映射
diff --git a/python/linkedlist.py b/python/linkedlist.py
new file mode 100644
index 0000000..d0b2087
--- /dev/null
+++ b/python/linkedlist.py
@@ -0,0 +1,154 @@
+class __Node(object):
+    
+    def __init__(self,value=None,next=None):
+        self.value = value;
+        self.next = next;
+    
+    def __str__(self):
+        return self.value;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# class LinkedList<T> {
+#   _Node? _dummyHead;
+#   late int _size;
+
+#   LinkedList() {
+#     _dummyHead = new _Node.withEmpty();
+#     _size = 0;
+#   }
+
+#   int getSize() {
+#     return _size;
+#   }
+
+#   bool isEmpty() {
+#     return _size == 0;
+#   }
+
+#   remove(int index){
+#     if (index < 0 || index > _size) {
+#       throw Exception("Remove Failed,Illegal index");
+#     }
+#     _Node? prev = _dummyHead;
+#     for(var i =0;i<index ;i++){
+#       prev = prev?.next;
+#     }
+#     _Node? retNode = prev!.next;
+#     prev.next = retNode!.next;
+#     retNode.next = null;
+#     _size --;
+#     return retNode.t;
+#   }
+
+#   //从链表中删除第一个元素，返回删除元素
+#   T? removeFirst(){
+#     remove(0);
+#   }
+#   //从链表中删除第一个元素，返回删除元素
+#   T? removeLast(){
+#     remove(_size -1);
+#   }
+
+
+#   //在链表的index位置添加新的元素e
+#   add(int index, T t) {
+#     if (index < 0 || index > _size) {
+#       throw Exception("Add Failed,Illegal index");
+#     }
+# //      if(index == 0){
+# //         addFirst(t);
+# //      }else{
+#     _Node? prev = _dummyHead;
+#     for (var i = 0; i < index; i++) {
+#       prev = prev?.next;
+#     }
+#     _Node _node = new _Node.wihtHead(t);
+#     _node.next = prev?.next;
+#     prev?.next = _node;
+#     _size++;
+# //      }
+#   }
+
+#   addLast(T t) {
+#     add(_size, t);
+#   }
+
+#   addFirst(T t) {
+# //      _Node _node =new _Node.head(t);
+# //      _node.next = _head;
+# //      _head = _node;
+#     add(0, t);
+#   }
+
+#   //获取链表第index位置的元素
+#   T get(int index){
+#     if (index < 0 || index > _size) {
+#       throw Exception("Get Failed,Illegal index");
+#     }
+#     _Node? cur = _dummyHead!.next;
+#     for(var i=0;i<index;i++){
+#       cur = cur!.next;
+#     }
+#     return cur!.t;
+#   }
+
+#   T getFirst(){
+#     return get(0);
+#   }
+#   T getLast(){
+#     return get(_size-1);
+#   }
+#   set(int index,T t){
+#     if (index < 0 || index > _size) {
+#       throw Exception("Set Failed,Illegal index");
+#     }
+#     _Node? cur = _dummyHead!.next;
+#     for(var i =0;i<index;i++){
+#       cur = cur!.next;
+#     }
+#     cur!.t= t;
+#   }
+
+#   bool contains(T t){
+#     _Node? cur = _dummyHead!.next;
+#     for(var i =0;i<_size-1;i++){
+#       if(cur!.t.compareTo(t)){
+#         return true;
+#       }
+#       cur = cur.next;
+#     }
+#     return false;
+#   }
+
+#   @override
+#   String toString() {
+#     StringBuffer res =new StringBuffer();
+#     for(_Node? cur = _dummyHead!.next ; cur != null ; cur = cur.next){
+#       res.write(cur);
+#       res.write("->");
+#     }
+#     res.write("NULL");
+#     return res.toString();
+#   }
+# }
+
+
diff --git a/python/multiSort.py b/python/multiSort.py
index 888e089..3b9753f 100644
--- a/python/multiSort.py
+++ b/python/multiSort.py
@@ -66,22 +66,75 @@ def shellSort(sortList):
                 j = j- dist
         dist = dist//2
     return sortList
+
+#快速排序
+def quickSort(sortList,left,right):
+    if left<right:
+        q = partition(sortList,left,right)
+        quickSort(sortList,left,q-1)
+        quickSort(sortList, q+1, right)
+
+def partition(sortList,left,right):
+    i = left-1
+    pivot  = sortList[right]
+    for j in range(left,right):
+        if sortList[j] <= pivot:
+            i +=1
+            sortList[i],sortList[j] = sortList[j],sortList[i]
+    sortList[i+1],sortList[right] = sortList[right],sortList[i+1]
+    return i +1    
+
+# 归并排序
+def merge(arr1, arr2): 
+    result = []
+    while arr1 and arr2:
+        if arr1[0] < arr2[0]:
+            result.append(arr1.pop(0))
+        else:
+            result.append(arr2.pop(0))
+    if arr1:
+        result += arr1
+    if arr2:
+        result += arr2
+    return result
+
+def merge_sort(arr):
+    if len(arr) <= 1:
+        return arr
+    mid = len(arr) // 2
+    return merge(merge_sort(arr[:mid]), merge_sort(arr[mid:]))
+
 # 计算结果，计算时间
 def caculateResultAndTime(name,fuction,randomseed):
-    print("--------------------",name)
+    print("--------------------",name,'\n')
     random.seed(randomseed)
-    sortList = [random.randint(0,100) for _ in range(10)]
+    sortList = [random.randint(0,100) for _ in range(30)]
     print("原始数据：",sortList)
     startTime = time.perf_counter()
     fuction(sortList)
     endTime = time.perf_counter()
-    print("排序结果:",sortList,' 花费时间：',endTime-startTime)
+    print("排序结果:",sortList,'\n花费时间：',endTime-startTime)
+    print("-------------------- 结束\n")
 
 if __name__ == '__main__':
     caculateResultAndTime("希尔排序",shellSort,88)
     caculateResultAndTime("插入排序",insertionSort,89)
     caculateResultAndTime("冒泡排序",bubble_sort,90)
     caculateResultAndTime("选择排序",selectionSort,91)
+    caculateResultAndTime("归并排序",selectionSort,93)
+
+    print("--------------------快速排序")
+    random.seed(92)
+    sortList = [random.randint(0,100) for _ in range(15)]
+    print("原始数据：",sortList)
+    startTime = time.perf_counter()
+    quickSort(sortList, 0, len(sortList)-1)
+    endTime = time.perf_counter()
+    print("排序结果:",sortList,' 花费时间：',endTime-startTime)
+    print("-------------------- 结束\n")
+
+
+    
         
     
 

From 04719e459d002d7416b2824fd0ce1e269bc1b63e Mon Sep 17 00:00:00 2001
From: "tianqing.liang" <1>
Date: Wed, 23 Mar 2022 16:27:04 +0800
Subject: [PATCH 17/21] =?UTF-8?q?=E5=BF=AB=E9=80=9F=E6=8E=92=E5=BA=8F?=
 =?UTF-8?q?=EF=BC=8C=E5=BD=92=E5=B9=B6=E6=8E=92=E5=BA=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 3f6cc82..418820e 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@
 4. **[Dart,Python]栈，队列，循环队列**
 5. 链表，链表实现栈，链表实现队列
 6. 递归
-7. 归并排序
+7. **[Dart,Python]归并排序**
 8. **[Dart,Python]快速排序**
 9. 二分搜索
 10. 二分搜索树

From 2e907e24f131a274347656b74a72e3fc27a25ee8 Mon Sep 17 00:00:00 2001
From: "tianqing.liang" <1>
Date: Wed, 23 Mar 2022 17:04:39 +0800
Subject: [PATCH 18/21] =?UTF-8?q?=E4=BA=8C=E5=88=86=E6=90=9C=E7=B4=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 README.md            |  2 +-
 python/linkedlist.py | 39 ++++++++++++++++++-----------------
 python/multiSort.py  | 49 +++++++++++++++++++++++++++++++++-----------
 3 files changed, 58 insertions(+), 32 deletions(-)

diff --git a/README.md b/README.md
index 418820e..963e74f 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@
 6. 递归
 7. **[Dart,Python]归并排序**
 8. **[Dart,Python]快速排序**
-9. 二分搜索
+9. **[Dart,Python]二分搜索**
 10. 二分搜索树
 11. 集合 和 映射
 12. 堆
diff --git a/python/linkedlist.py b/python/linkedlist.py
index d0b2087..c2c7bbb 100644
--- a/python/linkedlist.py
+++ b/python/linkedlist.py
@@ -7,7 +7,25 @@ def __init__(self,value=None,next=None):
     def __str__(self):
         return self.value;
 
+class LinkedList(object):
+
+    def __init__(self):
+        self.__head = None
+        self.__size = 0
+        
+    def getSize(self):
+        return self.__size
+    
+    def isEmpty(self):
+        return self.__size == 0;
 
+    def remove(self,index):
+        if index<0 or index> self.__size:
+            raise Exception("Remove Failed,Illegal index")
+        prev = self.__head
+        for i in range(0,index):
+            prev = prev.next
+        
 
 
 
@@ -27,27 +45,10 @@ def __str__(self):
 
 
 
-# class LinkedList<T> {
-#   _Node? _dummyHead;
-#   late int _size;
-
-#   LinkedList() {
-#     _dummyHead = new _Node.withEmpty();
-#     _size = 0;
-#   }
-
-#   int getSize() {
-#     return _size;
-#   }
-
-#   bool isEmpty() {
-#     return _size == 0;
-#   }
 
+# class LinkedList<T> {
 #   remove(int index){
-#     if (index < 0 || index > _size) {
-#       throw Exception("Remove Failed,Illegal index");
-#     }
+#     
 #     _Node? prev = _dummyHead;
 #     for(var i =0;i<index ;i++){
 #       prev = prev?.next;
diff --git a/python/multiSort.py b/python/multiSort.py
index 3b9753f..8b98d67 100644
--- a/python/multiSort.py
+++ b/python/multiSort.py
@@ -4,6 +4,8 @@
     选择排序
     插入排序
     希尔排序
+    快速排序
+    归并排序
 '''
 import random
 import time
@@ -85,24 +87,38 @@ def partition(sortList,left,right):
     return i +1    
 
 # 归并排序
-def merge(arr1, arr2): 
+def merge(sortList1, sortList2): 
     result = []
     while arr1 and arr2:
-        if arr1[0] < arr2[0]:
-            result.append(arr1.pop(0))
+        if sortList1[0] < sortList2[0]:
+            result.append(sortList1.pop(0))
         else:
-            result.append(arr2.pop(0))
-    if arr1:
-        result += arr1
-    if arr2:
-        result += arr2
+            result.append(sortList2.pop(0))
+    if sortList1:
+        result += sortList1
+    if sortList2:
+        result += sortList2
     return result
 
-def merge_sort(arr):
-    if len(arr) <= 1:
+def merge_sort(sortList):
+    if len(sortList) <= 1:
         return arr
-    mid = len(arr) // 2
-    return merge(merge_sort(arr[:mid]), merge_sort(arr[mid:]))
+    mid = len(sortList) // 2
+    return merge(merge_sort(sortList[:mid]), merge_sort(sortList[mid:]))
+
+# 二分搜索
+def binarySearch(sortList,left,right,x):
+    if right >= left :
+        mid = int(left + (right-left)/2)
+        if sortList[mid] == x:
+            return mid
+        elif sortList[mid] >x:
+            return binarySearch(sortList, left, mid-1, x) 
+        else:
+            return binarySearch(sortList, mid+1, right, x)
+    else:
+        return -1 
+
 
 # 计算结果，计算时间
 def caculateResultAndTime(name,fuction,randomseed):
@@ -133,6 +149,15 @@ def caculateResultAndTime(name,fuction,randomseed):
     print("排序结果:",sortList,' 花费时间：',endTime-startTime)
     print("-------------------- 结束\n")
 
+    print("--------------------二分搜索")
+    sortList = list(range(15))
+    print("原始数据：",sortList)
+    startTime = time.perf_counter()
+    result = binarySearch(sortList, 0, len(sortList)-1,10)
+    endTime = time.perf_counter()
+    print("查找结果:",result,' 花费时间：',endTime-startTime)
+    print("-------------------- 结束\n")
+
 
     
         

From 3666b672015bf0630f498019d8676bffd728f417 Mon Sep 17 00:00:00 2001
From: "tianqing.liang" <1>
Date: Thu, 24 Mar 2022 16:45:16 +0800
Subject: [PATCH 19/21] =?UTF-8?q?=E9=93=BE=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 README.md            |   3 +-
 python/linkedlist.py | 204 +++++++++++++++----------------------------
 python/multiSort.py  |   3 +
 3 files changed, 76 insertions(+), 134 deletions(-)

diff --git a/README.md b/README.md
index 963e74f..0eda79e 100644
--- a/README.md
+++ b/README.md
@@ -2,12 +2,11 @@
 
 <h3>使用Python、Flutter的Dart语言重写数据结构与算法</h3>
 
-
 1. **[Dart,Python]线性搜索**
 2. **[Dart,Python]选择排序**
 3. **[Dart,Python]插入排序**
 4. **[Dart,Python]栈，队列，循环队列**
-5. 链表，链表实现栈，链表实现队列
+5. **[Dart,Python]链表，链表实现栈，链表实现队列**
 6. 递归
 7. **[Dart,Python]归并排序**
 8. **[Dart,Python]快速排序**
diff --git a/python/linkedlist.py b/python/linkedlist.py
index c2c7bbb..cea6b0d 100644
--- a/python/linkedlist.py
+++ b/python/linkedlist.py
@@ -1,30 +1,89 @@
-class __Node(object):
+class Node(object):
     
-    def __init__(self,value=None,next=None):
+    def __init__(self,value):
         self.value = value;
-        self.next = next;
+        self.next = None;
     
     def __str__(self):
         return self.value;
 
+
 class LinkedList(object):
 
     def __init__(self):
-        self.__head = None
-        self.__size = 0
+        self.head = None
+        self.size = 0
         
     def getSize(self):
-        return self.__size
+        return self.size
     
     def isEmpty(self):
-        return self.__size == 0;
+        return self.size == 0;
+    
+    #头部添加元素
+    def add(self, value):
+        node = Node(value)
+        node.next = self.head
+        self.head = node
+        self.size +=1
+
+    # 尾部添加元素
+    def append(self, value):
+        node = Node(value)
+        if self.isEmpty():
+            self.head = node
+        else:
+            cur = self.head
+            while cur.next != None:
+                cur = cur.next
+            cur.next = node
+        self.size +=1
+    
+    # 指定位置添加元素
+    def insert(self, pos, value):
+        if pos <= 0:
+            self.add(value)
+        elif pos > self.size:
+            self.append(value)
+        else:
+            node = Node(value)
+            count = 0
+            pre = self.head
+            while count < (pos-1):
+                count += 1
+                pre = pre.next
+            node.next = pre.next
+            pre.next = node
+            self.size +=1 
+    
+    # 删除节点
+    def remove(self,value):
+        cur = self.head
+        pre = None
+        isFind = False
+        while cur != None:
+            if cur.value == value:
+                if not pre:
+                    self.head = cur.next
+                else:
+                    pre.next = cur.next
+                self.size -=1
+                isFind = True
+                break
+            else:
+                pre = cur
+                cur = cur.next
+        return isFind
+
+    # 查找节点是否存在     
+    def search(self,value):
+        cur = self.head
+        while cur != None:
+            if cur.value == value:
+                return True
+            cur = cur.next
+        return False
 
-    def remove(self,index):
-        if index<0 or index> self.__size:
-            raise Exception("Remove Failed,Illegal index")
-        prev = self.__head
-        for i in range(0,index):
-            prev = prev.next
         
 
 
@@ -34,122 +93,3 @@ def remove(self,index):
 
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-# class LinkedList<T> {
-#   remove(int index){
-#     
-#     _Node? prev = _dummyHead;
-#     for(var i =0;i<index ;i++){
-#       prev = prev?.next;
-#     }
-#     _Node? retNode = prev!.next;
-#     prev.next = retNode!.next;
-#     retNode.next = null;
-#     _size --;
-#     return retNode.t;
-#   }
-
-#   //从链表中删除第一个元素，返回删除元素
-#   T? removeFirst(){
-#     remove(0);
-#   }
-#   //从链表中删除第一个元素，返回删除元素
-#   T? removeLast(){
-#     remove(_size -1);
-#   }
-
-
-#   //在链表的index位置添加新的元素e
-#   add(int index, T t) {
-#     if (index < 0 || index > _size) {
-#       throw Exception("Add Failed,Illegal index");
-#     }
-# //      if(index == 0){
-# //         addFirst(t);
-# //      }else{
-#     _Node? prev = _dummyHead;
-#     for (var i = 0; i < index; i++) {
-#       prev = prev?.next;
-#     }
-#     _Node _node = new _Node.wihtHead(t);
-#     _node.next = prev?.next;
-#     prev?.next = _node;
-#     _size++;
-# //      }
-#   }
-
-#   addLast(T t) {
-#     add(_size, t);
-#   }
-
-#   addFirst(T t) {
-# //      _Node _node =new _Node.head(t);
-# //      _node.next = _head;
-# //      _head = _node;
-#     add(0, t);
-#   }
-
-#   //获取链表第index位置的元素
-#   T get(int index){
-#     if (index < 0 || index > _size) {
-#       throw Exception("Get Failed,Illegal index");
-#     }
-#     _Node? cur = _dummyHead!.next;
-#     for(var i=0;i<index;i++){
-#       cur = cur!.next;
-#     }
-#     return cur!.t;
-#   }
-
-#   T getFirst(){
-#     return get(0);
-#   }
-#   T getLast(){
-#     return get(_size-1);
-#   }
-#   set(int index,T t){
-#     if (index < 0 || index > _size) {
-#       throw Exception("Set Failed,Illegal index");
-#     }
-#     _Node? cur = _dummyHead!.next;
-#     for(var i =0;i<index;i++){
-#       cur = cur!.next;
-#     }
-#     cur!.t= t;
-#   }
-
-#   bool contains(T t){
-#     _Node? cur = _dummyHead!.next;
-#     for(var i =0;i<_size-1;i++){
-#       if(cur!.t.compareTo(t)){
-#         return true;
-#       }
-#       cur = cur.next;
-#     }
-#     return false;
-#   }
-
-#   @override
-#   String toString() {
-#     StringBuffer res =new StringBuffer();
-#     for(_Node? cur = _dummyHead!.next ; cur != null ; cur = cur.next){
-#       res.write(cur);
-#       res.write("->");
-#     }
-#     res.write("NULL");
-#     return res.toString();
-#   }
-# }
-
-
diff --git a/python/multiSort.py b/python/multiSort.py
index 8b98d67..4731ed5 100644
--- a/python/multiSort.py
+++ b/python/multiSort.py
@@ -6,6 +6,7 @@
     希尔排序
     快速排序
     归并排序
+    二分搜索
 '''
 import random
 import time
@@ -158,6 +159,8 @@ def caculateResultAndTime(name,fuction,randomseed):
     print("查找结果:",result,' 花费时间：',endTime-startTime)
     print("-------------------- 结束\n")
 
+    
+
 
     
         

From dc5b236950526af3699c08c9b779c642cbc5e412 Mon Sep 17 00:00:00 2001
From: "tianqing.liang" <1>
Date: Fri, 25 Mar 2022 15:48:11 +0800
Subject: [PATCH 20/21] =?UTF-8?q?=E9=80=92=E5=BD=92?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 README.md           | 2 +-
 python/multiSort.py | 8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 0eda79e..48e1674 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@
 3. **[Dart,Python]插入排序**
 4. **[Dart,Python]栈，队列，循环队列**
 5. **[Dart,Python]链表，链表实现栈，链表实现队列**
-6. 递归
+6. **[Dart,Python]递归**
 7. **[Dart,Python]归并排序**
 8. **[Dart,Python]快速排序**
 9. **[Dart,Python]二分搜索**
diff --git a/python/multiSort.py b/python/multiSort.py
index 4731ed5..09f9eca 100644
--- a/python/multiSort.py
+++ b/python/multiSort.py
@@ -120,6 +120,10 @@ def binarySearch(sortList,left,right,x):
     else:
         return -1 
 
+def sumNumber(n):
+    if n == 0:
+        return 0
+    return n+sumNumber(n-1)
 
 # 计算结果，计算时间
 def caculateResultAndTime(name,fuction,randomseed):
@@ -158,8 +162,10 @@ def caculateResultAndTime(name,fuction,randomseed):
     endTime = time.perf_counter()
     print("查找结果:",result,' 花费时间：',endTime-startTime)
     print("-------------------- 结束\n")
-
     
+    print("--------------------递归函数")
+    print('递归结果：',sumNumber(100))
+    print("-------------------- 结束\n")
 
 
     

From 72474cf32e78b68f4301af6ac92e8cf1c8a84168 Mon Sep 17 00:00:00 2001
From: "tianqing.liang" <1>
Date: Wed, 30 Mar 2022 15:32:36 +0800
Subject: [PATCH 21/21] =?UTF-8?q?=E4=BA=8C=E5=88=86=E6=90=9C=E7=B4=A2?=
 =?UTF-8?q?=E6=A0=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 README.md            |   2 +-
 python/BST.py        | 106 +++++++++++++++++++++++++++++++++++++++++++
 python/linkedlist.py |   4 +-
 python/loopqueue.py  |   3 ++
 4 files changed, 113 insertions(+), 2 deletions(-)
 create mode 100644 python/BST.py

diff --git a/README.md b/README.md
index 48e1674..da2c17e 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@
 7. **[Dart,Python]归并排序**
 8. **[Dart,Python]快速排序**
 9. **[Dart,Python]二分搜索**
-10. 二分搜索树
+10. **[Dart,Python]二分搜索树**
 11. 集合 和 映射
 12. 堆
 13. 优先队列
diff --git a/python/BST.py b/python/BST.py
new file mode 100644
index 0000000..59ec54b
--- /dev/null
+++ b/python/BST.py
@@ -0,0 +1,106 @@
+class BSTNode(object):
+    def __init__(self, key, value, left=None, right=None):
+        self.key, self.value, self.left, self.right = key, value, left, right
+
+
+class BST(object):
+    def __init__(self, root=None):
+        self.root = root
+
+    @classmethod
+    def build_from(cls, node_list):
+        cls.size = 0
+        key_to_node_dict = {}
+        for node_dict in node_list:
+            key = node_dict['key']
+            key_to_node_dict[key] = BSTNode(key, value=key) 
+
+        for node_dict in node_list:
+            key = node_dict['key']
+            node = key_to_node_dict[key]
+            if node_dict['is_root']:
+                root = node
+            node.left = key_to_node_dict.get(node_dict['left'])
+            node.right = key_to_node_dict.get(node_dict['right'])
+            cls.size += 1
+        return cls(root)
+
+    def _bst_search(self, subtree, key):
+        if subtree is None:  
+            return None
+        elif key < subtree.key:
+            return self._bst_search(subtree.left, key)
+        elif key > subtree.key:
+            return self._bst_search(subtree.right, key)
+        else:
+            return subtree
+
+    def __contains__(self, key):
+        return self._bst_search(self.root, key) is not None
+
+    def get(self, key, default=None):
+        node = self._bst_search(self.root, key)
+        if node is None:
+            return default
+        else:
+            return node.value
+
+    def _bst_min_node(self, subtree):
+        if subtree is None:
+            return None
+        elif subtree.left is None:  
+            return subtree
+        else:
+            return self._bst_min_node(subtree.left)
+
+    def bst_min(self):
+        node = self._bst_min_node(self.root)
+        return node.value if node else None
+
+    def _bst_insert(self, subtree, key, value):
+        
+        if subtree is None:   
+            subtree = BSTNode(key, value)
+        elif key < subtree.key:
+            subtree.left = self._bst_insert(subtree.left, key, value)
+        elif key > subtree.key:
+            subtree.right = self._bst_insert(subtree.right, key, value)
+        return subtree
+
+    def add(self, key, value):
+        node = self._bst_search(self.root, key)
+        if node is not None:  
+            node.value = value
+            return False
+        else:
+            self.root = self._bst_insert(self.root, key, value)
+            self.size += 1
+            return True
+
+    def _bst_remove(self, subtree, key):
+        if subtree is None:
+            return None
+        elif key < subtree.key:
+            subtree.left = self._bst_remove(subtree.left, key)
+            return subtree
+        elif key > subtree.key:
+            subtree.right = self._bst_remove(subtree.right, key)
+            return subtree
+        else:  # 找到了需要删除的节点
+            if subtree.left is None and subtree.right is None:    # 叶节点，返回 None 把其父亲指向它的指针置为 None
+                return None
+            elif subtree.left is None or subtree.right is None:  # 只有一个孩子
+                if subtree.left is not None:
+                    return subtree.left   # 返回它的孩子并让它的父亲指过去
+                else:
+                    return subtree.right
+            else:  # 俩孩子，寻找后继节点替换，并删除其右子树的后继节点，同时更新其右子树
+                successor_node = self._bst_min_node(subtree.right)
+                subtree.key, subtree.value = successor_node.key, successor_node.value
+                subtree.right = self._bst_remove(subtree.right, successor_node.key)
+                return subtree
+
+    def remove(self, key):
+        assert key in self
+        self.size -= 1
+        return self._bst_remove(self.root, key)
\ No newline at end of file
diff --git a/python/linkedlist.py b/python/linkedlist.py
index cea6b0d..e7c87fa 100644
--- a/python/linkedlist.py
+++ b/python/linkedlist.py
@@ -7,7 +7,9 @@ def __init__(self,value):
     def __str__(self):
         return self.value;
 
-
+'''
+    链表
+'''
 class LinkedList(object):
 
     def __init__(self):
diff --git a/python/loopqueue.py b/python/loopqueue.py
index f5e8eb2..bb4f152 100644
--- a/python/loopqueue.py
+++ b/python/loopqueue.py
@@ -1,3 +1,6 @@
+'''
+    循环队列
+'''
 class LoopQueue(object):
 
     def __init__(self, n=10):
