Data structures and algorithms (C # implementation) series --- demonstration (1)

Source: Internet
Author: User
Tags rpn calculator

Data structures and algorithms (C # implementation) series --- demonstration (1)

Heavenkiller (original)

This article provides a substantial demonstration of the Data Types in the future. Therefore, I hope you can read the analysis of various data structures again.

The demo mainly includes the following aspects:

1. Stack. Demonstrate an RPN calculator using stacks

2. Sort the table. Demonstrate an addition operation of Polynomial expressions using sorting tables

3. generalized tree. Demonstrate depth traversal and breadth Traversal

4. N. Demonstrate basic operations such as generation, insertion, and deletion of the N-tree

5. Expression Tree. Demonstrate an example of translating a suffix expression into a common infix expression using a binary tree and a stack.

6. AVL Tree. Demonstrate basic operations

 

 

Using System;

Using System. Collections;

 

Namespace DataStructure

{

/// <Summary>

/// Summary of Class1.

/// </Summary>

Class Show

{

/// <Summary>

/// Main entry point of the application.

/// </Summary>

[STAThread]

Static void Main (string [] args)

{

//

// TODO: Add code here to start the application

//

While (true)

{

Console. WriteLine ("please choose a 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 ");

Console. WriteLine ("5. ExpressionTree ");

Console. WriteLine ("6. AVLTree ");

Console. WriteLine ("7. BinaryHeap ");

Console. WriteLine ("exit -- Exit this programme ");

// Test ();

Switch (Console. ReadLine ())

{

Case "1": // Show Stack

ShowStack_RPNCalCulator ();

Break;

Case "2": // SortedList

ShowSortedList_Polynomial ();

Break;

Case "3 ":

ShowGeneralTree_travel ();

Break;

Case "4 ":

ShowNaryTree (); // demonstrate Attach and Detach of A Three-tree

Break;

Case "5 ":

ShowExpressionTree ();

Break;

Case "6 ":

ShowAVLTree ();

Break;

Case "7 ":

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.