summaryrefslogtreecommitdiff
path: root/Assets/Test
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/Test')
-rw-r--r--Assets/Test/04_Pathfinding/AStarPathfinding.cs18
-rw-r--r--Assets/Test/04_Pathfinding/AStarPathfinding.cs.meta11
-rw-r--r--Assets/Test/05_Recursion/Test_Recursion.cs22
3 files changed, 21 insertions, 30 deletions
diff --git a/Assets/Test/04_Pathfinding/AStarPathfinding.cs b/Assets/Test/04_Pathfinding/AStarPathfinding.cs
deleted file mode 100644
index 80ba51d..0000000
--- a/Assets/Test/04_Pathfinding/AStarPathfinding.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class AStarPathfinding : MonoBehaviour
-{
- // Start is called before the first frame update
- void Start()
- {
-
- }
-
- // Update is called once per frame
- void Update()
- {
-
- }
-}
diff --git a/Assets/Test/04_Pathfinding/AStarPathfinding.cs.meta b/Assets/Test/04_Pathfinding/AStarPathfinding.cs.meta
deleted file mode 100644
index 5cd6112..0000000
--- a/Assets/Test/04_Pathfinding/AStarPathfinding.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 66158ef978f1a7540addceae83d08239
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/Test/05_Recursion/Test_Recursion.cs b/Assets/Test/05_Recursion/Test_Recursion.cs
index 9399bc3..830d2df 100644
--- a/Assets/Test/05_Recursion/Test_Recursion.cs
+++ b/Assets/Test/05_Recursion/Test_Recursion.cs
@@ -16,7 +16,9 @@ public class Test_Recursion : MonoBehaviour
//TestMergeSort();
//TestQuickSort();
//TestBubbleSort();
- TestSelect();
+ //TestSelect();
+ //TestLCS();
+ TestMaxSum();
}
void TestPermutations()
@@ -154,4 +156,22 @@ public class Test_Recursion : MonoBehaviour
}
}
+ void TestLCS()
+ {
+ List<char> lcs = new List<char>();
+ RecursionHelper.FindLCSP("acbcbcef".ToCharArray(), "abcbced".ToCharArray(), ref lcs);
+ Debug.Log(Algorithms.ListToString(lcs));
+
+ lcs.Clear();
+ RecursionHelper.FindLCSS("acbcbcef".ToCharArray(), "abcbced".ToCharArray(), ref lcs);
+ Debug.Log(Algorithms.ListToString(lcs));
+ }
+
+ void TestMaxSum()
+ {
+ int[] n = new int[] { -2, 11, -4, 13, -5, -2};
+ int max = RecursionHelper.CalMaxSum(n);
+ Debug.Log("最大子段和=" + max);
+ }
+
}