Giter VIP home page Giter VIP logo

ctree's Introduction

题目:树的建立及其操作

基本要求

⑴ 树的建立:以(结点编号,结点数据,父结点编号)的形式从键盘输入一棵n叉树(n≥3),根结点的父结点编号为-1,将树按双亲表示法存储在一维数组中。

⑵ 树的输出:将所建立的按双亲表示法存储的树转换形成按孩子—兄弟链表法的形式保存并输出。

⑶ 树的先序遍历:按先序遍历方式对树进行遍历,输出对应的遍历序列。

⑷ 树的后序遍历:按后序遍历方式对树进行遍历,输出对应的遍历序列。

⑸ 树的层次遍历:按层次遍历方式对树进行遍历,输出对应的遍历序列。

⑹ 树中结点度的统计:分别统计树中度为0、1、2…的结点数目。

⑺ 设计一个菜单,上述操作要求都作为菜单中的主要菜单项。

ctree's People

Contributors

yeguiwu avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.