數(shù)據(jù)結(jié)構(gòu)與算法(C#實(shí)現(xiàn))系列---演示篇(一)
Heavenkiller(原創(chuàng))
這一篇主要是針對(duì)以后各篇的數(shù)據(jù)類(lèi)型進(jìn)行一個(gè)實(shí)質(zhì)性的演示。因此希望大家具體看了各種數(shù)據(jù)結(jié)構(gòu)的分析之后再看這篇。
主要包括如下幾個(gè)方面的演示:
1. 堆棧。 演示了一個(gè)利用堆棧作的RPN計(jì)算器
2. 排序表。演示了一個(gè)利用排序表做的多項(xiàng)式表達(dá)式的加法運(yùn)算
3. 廣義樹(shù)。演示了深度遍歷和廣度遍歷
4. N叉樹(shù)。演示了N叉樹(shù)的生成插入刪除等基本操作
5. 表達(dá)式樹(shù)。演示了一個(gè)用二叉樹(shù)和堆棧做的可以將一個(gè)后綴表達(dá)式翻譯為日常中熟悉的中綴表達(dá)式的例子
6. AVL樹(shù)。演示了基本操作
using System;
using System.Collections;
namespace DataStructure
{
/// <summary>
/// Class1 的摘要說(shuō)明。
/// </summary>
class Show
{
/// <summary>
/// 應(yīng)用程序的主入口點(diǎn)。
/// </summary>
[STAThread]
static void Main(string[] args)
{
//
// TODO: 在此處添加代碼以啟動(dòng)應(yīng)用程序
//
while(true)
{
Console.WriteLine("please choose a the No. of a item you want to perform:");
Console.WriteLine("1.Stack----- RPNCalCulator");
Console.WriteLine("2.SortedList-----the addition of polynomial realized by sortedlist ");
Console.WriteLine("3.GeneralTree----depthtravesal and breathtraval");
Console.WriteLine("4.NaryTree");
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注