Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
TinySTL
提交
9a13d7ac
T
TinySTL
项目概览
OpenDocCN
/
TinySTL
通知
4
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TinySTL
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
9a13d7ac
编写于
2月 14, 2015
作者:
邹
邹晓航
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
No commit message
No commit message
上级
02c3088e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
64 addition
and
3 deletion
+64
-3
README.md
README.md
+39
-1
TinySTL/TinySTL.vcxproj
TinySTL/TinySTL.vcxproj
+6
-0
TinySTL/TinySTL.vcxproj.filters
TinySTL/TinySTL.vcxproj.filters
+17
-0
TinySTL/main.cpp
TinySTL/main.cpp
+2
-2
未找到文件。
README.md
浏览文件 @
9a13d7ac
...
@@ -79,6 +79,7 @@ TinySTL
...
@@ -79,6 +79,7 @@ TinySTL
*
avl_tree:100%
*
avl_tree:100%
*
suffix_array:100%
*
suffix_array:100%
*
directed_graph:100%
*
directed_graph:100%
*
trie tree:100%
##TinySTL单元测试(原单元测试代码逐步):
##TinySTL单元测试(原单元测试代码逐步):
*
pair:100%
*
pair:100%
...
@@ -97,6 +98,7 @@ TinySTL
...
@@ -97,6 +98,7 @@ TinySTL
*
avl_tree:100%
*
avl_tree:100%
*
unordered_set:100%
*
unordered_set:100%
*
directed_graph:100%
*
directed_graph:100%
*
trie tree:100%
#TinySTL性能测试:
#TinySTL性能测试:
###测试环境:Windows 7 && VS2013 && release模式
###测试环境:Windows 7 && VS2013 && release模式
...
@@ -488,4 +490,40 @@ TinySTL
...
@@ -488,4 +490,40 @@ TinySTL
![
image
](
https://raw.githubusercontent.com/zouxiaohang/TinySTL/master/TinySTL/ScreenShots/graph1.png
)
![
image
](
https://raw.githubusercontent.com/zouxiaohang/TinySTL/master/TinySTL/ScreenShots/graph1.png
)
![
image
](
https://raw.githubusercontent.com/zouxiaohang/TinySTL/master/TinySTL/ScreenShots/graph_dfs.png
)
![
image
](
https://raw.githubusercontent.com/zouxiaohang/TinySTL/master/TinySTL/ScreenShots/graph_dfs.png
)
![
image
](
https://raw.githubusercontent.com/zouxiaohang/TinySTL/master/TinySTL/ScreenShots/graph_bfs.png
)
![
image
](
https://raw.githubusercontent.com/zouxiaohang/TinySTL/master/TinySTL/ScreenShots/graph_bfs.png
)
![
image
](
https://raw.githubusercontent.com/zouxiaohang/TinySTL/master/TinySTL/ScreenShots/graph2.png
)
![
image
](
https://raw.githubusercontent.com/zouxiaohang/TinySTL/master/TinySTL/ScreenShots/graph2.png
)
\ No newline at end of file
####(16):trie tree
TinySTL::trie_tree t;
std::ifstream in;
in.open("C:\\Users\\zxh\\Desktop\\trie_tree_test.txt");
std::vector<std::string> v;
std::string s;
while (in){
in >> s;
v.push_back(s);
}
ProfilerInstance::start();
for (const auto& str : v){
t.insert(TinySTL::string(str.data()));
}
ProfilerInstance::finish();
std::cout << "build trie tree costs " << ProfilerInstance::millisecond() << "ms" << std::endl;
ProfilerInstance::start();
auto res = t.get_word_by_prefix("v");
ProfilerInstance::finish();
std::cout << "get word by prefix \"v\" costs " << ProfilerInstance::millisecond() << "ms" << std::endl;
auto i = 0;
for (const auto& str : res){
++i;
if (i % 10 == 0) std::cout << std::endl;
std::cout << str << " ";
}
std::cout << std::endl;
![
image
](
https://raw.githubusercontent.com/zouxiaohang/TinySTL/master/TinySTL/ScreenShots/trie_tree.png
)
\ No newline at end of file
TinySTL/TinySTL.vcxproj
浏览文件 @
9a13d7ac
...
@@ -99,6 +99,7 @@
...
@@ -99,6 +99,7 @@
<ClCompile
Include=
"Test\StackTest.cpp"
/>
<ClCompile
Include=
"Test\StackTest.cpp"
/>
<ClCompile
Include=
"Test\StringTest.cpp"
/>
<ClCompile
Include=
"Test\StringTest.cpp"
/>
<ClCompile
Include=
"Test\SuffixArrayTest.cpp"
/>
<ClCompile
Include=
"Test\SuffixArrayTest.cpp"
/>
<ClCompile
Include=
"Test\TrieTreeTest.cpp"
/>
<ClCompile
Include=
"Test\Unordered_setTest.cpp"
/>
<ClCompile
Include=
"Test\Unordered_setTest.cpp"
/>
<ClCompile
Include=
"Test\VectorTest.cpp"
/>
<ClCompile
Include=
"Test\VectorTest.cpp"
/>
</ItemGroup>
</ItemGroup>
...
@@ -146,6 +147,7 @@
...
@@ -146,6 +147,7 @@
<ClInclude
Include=
"Test\StringTest.h"
/>
<ClInclude
Include=
"Test\StringTest.h"
/>
<ClInclude
Include=
"Test\SuffixArrayTest.h"
/>
<ClInclude
Include=
"Test\SuffixArrayTest.h"
/>
<ClInclude
Include=
"Test\TestUtil.h"
/>
<ClInclude
Include=
"Test\TestUtil.h"
/>
<ClInclude
Include=
"Test\TrieTreeTest.h"
/>
<ClInclude
Include=
"Test\Unordered_setTest.h"
/>
<ClInclude
Include=
"Test\Unordered_setTest.h"
/>
<ClInclude
Include=
"Test\VectorTest.h"
/>
<ClInclude
Include=
"Test\VectorTest.h"
/>
<ClInclude
Include=
"TrieTree.h"
/>
<ClInclude
Include=
"TrieTree.h"
/>
...
@@ -164,6 +166,10 @@
...
@@ -164,6 +166,10 @@
<Image
Include=
"ScreenShots\graph_bfs.png"
/>
<Image
Include=
"ScreenShots\graph_bfs.png"
/>
<Image
Include=
"ScreenShots\graph_dfs.png"
/>
<Image
Include=
"ScreenShots\graph_dfs.png"
/>
<Image
Include=
"ScreenShots\suffix_array.png"
/>
<Image
Include=
"ScreenShots\suffix_array.png"
/>
<Image
Include=
"ScreenShots\trie_tree.png"
/>
</ItemGroup>
<ItemGroup>
<Text
Include=
"TestData\trie_tree_test.txt"
/>
</ItemGroup>
</ItemGroup>
<Import
Project=
"$(VCTargetsPath)\Microsoft.Cpp.targets"
/>
<Import
Project=
"$(VCTargetsPath)\Microsoft.Cpp.targets"
/>
<ImportGroup
Label=
"ExtensionTargets"
>
<ImportGroup
Label=
"ExtensionTargets"
>
...
...
TinySTL/TinySTL.vcxproj.filters
浏览文件 @
9a13d7ac
...
@@ -25,6 +25,9 @@
...
@@ -25,6 +25,9 @@
<Filter
Include=
"Detail"
>
<Filter
Include=
"Detail"
>
<UniqueIdentifier>
{7dd5c5f0-33b6-44c6-b2b9-d4c0ec1d4c13}
</UniqueIdentifier>
<UniqueIdentifier>
{7dd5c5f0-33b6-44c6-b2b9-d4c0ec1d4c13}
</UniqueIdentifier>
</Filter>
</Filter>
<Filter
Include=
"TestData"
>
<UniqueIdentifier>
{676114e9-f556-46bf-9f51-65d820758de2}
</UniqueIdentifier>
</Filter>
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<ClCompile
Include=
"Profiler\Profiler.cpp"
>
<ClCompile
Include=
"Profiler\Profiler.cpp"
>
...
@@ -90,6 +93,9 @@
...
@@ -90,6 +93,9 @@
<ClCompile
Include=
"Detail\TireTree.cpp"
>
<ClCompile
Include=
"Detail\TireTree.cpp"
>
<Filter>
Detail
</Filter>
<Filter>
Detail
</Filter>
</ClCompile>
</ClCompile>
<ClCompile
Include=
"Test\TrieTreeTest.cpp"
>
<Filter>
Test
</Filter>
</ClCompile>
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<ClInclude
Include=
"TypeTraits.h"
>
<ClInclude
Include=
"TypeTraits.h"
>
...
@@ -245,6 +251,9 @@
...
@@ -245,6 +251,9 @@
<ClInclude
Include=
"TrieTree.h"
>
<ClInclude
Include=
"TrieTree.h"
>
<Filter>
头文件
</Filter>
<Filter>
头文件
</Filter>
</ClInclude>
</ClInclude>
<ClInclude
Include=
"Test\TrieTreeTest.h"
>
<Filter>
Test
</Filter>
</ClInclude>
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<None
Include=
"..\README.md"
/>
<None
Include=
"..\README.md"
/>
...
@@ -265,5 +274,13 @@
...
@@ -265,5 +274,13 @@
<Image
Include=
"ScreenShots\graph2.png"
>
<Image
Include=
"ScreenShots\graph2.png"
>
<Filter>
ScreenShots
</Filter>
<Filter>
ScreenShots
</Filter>
</Image>
</Image>
<Image
Include=
"ScreenShots\trie_tree.png"
>
<Filter>
ScreenShots
</Filter>
</Image>
</ItemGroup>
<ItemGroup>
<Text
Include=
"TestData\trie_tree_test.txt"
>
<Filter>
TestData
</Filter>
</Text>
</ItemGroup>
</ItemGroup>
</Project>
</Project>
\ No newline at end of file
TinySTL/main.cpp
浏览文件 @
9a13d7ac
...
@@ -17,11 +17,10 @@
...
@@ -17,11 +17,10 @@
#include "Test\StackTest.h"
#include "Test\StackTest.h"
#include "Test\StringTest.h"
#include "Test\StringTest.h"
#include "Test\SuffixArrayTest.h"
#include "Test\SuffixArrayTest.h"
#include "Test\TrieTreeTest.h"
#include "Test\Unordered_setTest.h"
#include "Test\Unordered_setTest.h"
#include "Test\VectorTest.h"
#include "Test\VectorTest.h"
#include "Graph.h"
using
namespace
TinySTL
::
Profiler
;
using
namespace
TinySTL
::
Profiler
;
int
main
(){
int
main
(){
...
@@ -39,6 +38,7 @@ int main(){
...
@@ -39,6 +38,7 @@ int main(){
TinySTL
::
StackTest
::
testAllCases
();
TinySTL
::
StackTest
::
testAllCases
();
TinySTL
::
StringTest
::
testAllCases
();
TinySTL
::
StringTest
::
testAllCases
();
TinySTL
::
SuffixArrayTest
::
testAllCases
();
TinySTL
::
SuffixArrayTest
::
testAllCases
();
TinySTL
::
TrieTreeTest
::
testAllCases
();
TinySTL
::
Unordered_setTest
::
testAllCases
();
TinySTL
::
Unordered_setTest
::
testAllCases
();
TinySTL
::
VectorTest
::
testAllCases
();
TinySTL
::
VectorTest
::
testAllCases
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录