- 129
- 0
- 约8.22千字
- 约 20页
- 2017-10-06 发布于河南
- 举报
基本pathyon知识及算法(Basic pathyon knowledge and algorithms)
基本pathyon知识及算法(Basic pathyon knowledge and algorithms)
Experimental report of Xian Jiao Tong University
Course Name: University computer basic experiment Name: tree and graph storage
College: College of science ___ ______________________ experimental date
Class: _ letter 11_______________ Name: ___ Wang rang _____________ number: 2110902016
1. experimental purposes
Learn how to solve problems through computer programs.
Understand the sequential storage of trees and graphs in a computer.
2. experiment tasks and requirements
(1) write programs to calculate information entropy. Requirement: the user enters the probability of each message element from the keyboard. The input 0 indicates the end of the input data, and the program calculates the information entropy and outputs the information
(2) to achieve the storage of two fork tree. Ask yourself to construct a two binary tree, the list stored in the calculation, a user input node value, computing nodes and sub nodes around his father and, if not, then display the message of no.
(3) storage of the drawing. To design a plan yourself, you should have at least 5 nodes and 6 sides. Stored in a computer, the user enters the name of the node, and if it is a node in the graph, displays its adjacent contact.
3. experimental tools and methods
Operating system: Windows operating system
Application software: Python language environment
4. experiment procedure and result
(1) I=0
A=float (input (Please, input, a=, probability))
While a! =0:!
Import math
B=math.log (a, 2)
I=I-a*b
A=float (input (Please, input, a=, probability))
Print (the entropy is, I)
Please input probability a=0.4
Please input probability a=0.22
Please input probability a=0.18
Please input probability a=0.1
Please input probability a=0.06
Please input probability a=0.04
Please input probability a=0
The entropy is 2.2161329359279525
(2)
Binarytree=[,A,B,C,D,#,E,F,#,#,G,#, H,I,J]
Bsize=13
A=input (enter a letter)
If a in binarytree:
L=binarytree.index (a)
If l==1:
您可能关注的文档
- 古代帝王的别称(Another name for ancient emperors).doc
- 古代最小资的职业(The occupation of the most petty bourgeoisie in ancient times).doc
- 古代舞蹈的遗存——於菟(The remains of the ancient dance - wutu).doc
- 古典诗词鉴赏综合能力训练(Classical poetry appreciation, comprehensive ability, training).doc
- 古剑奇谭全部武器(Qi tan all weapons.).doc
- 古建筑结构(Ancient architecture).doc
- 古剑奇谭物品掉落出处(Qi Tan loot source).doc
- 古文与诗词计算机(Ancient poetry and poetry computer).doc
- 古永锵模式不能管理定成败(Gu Yongqiang patterns can not be managed, set success or failure).doc
- 古汉知识(The ancient Chinese knowledge).doc
- 伟明环保-市场前景及投资研究报告-境内业务稳健运行,印尼市场贡献边际增量.pdf
- 桂东县法院系统招聘考试真题2025.pdf
- 贵州省黔南布依族2026年中考三模物理试题及答案.pdf
- 贵州省黔南州2026年中考语文二模试卷附答案.pdf
- 贵州省铜仁市2026年中考语文二模试卷附答案.pdf
- 2026上半年安徽事业单位联考合肥市庐江县招聘36人备考题库及一套完整答案详解.docx
- 贵州省毕节市2026年中考语文一模试卷附答案.pdf
- 贵州省贵阳市南明区2026年中考语文一模试卷附答案.pdf
- 2026上半年安徽事业单位联考合肥市庐江县招聘36人备考题库及一套参考答案详解.docx
- 贵州省贵阳市白云区2026年中考二模物理试题附答案.pdf
最近下载
- 2024年浙江省中考英语真题卷(含答案与解析)_7429.pdf VIP
- 华东师大版八下历史第二单元第4课-“大跃进”和人民公社化运动PPT24张.ppt VIP
- 2012上海杨浦区高三英语二模试卷及答案.doc VIP
- FANUC数控车床的主轴控制设计.doc VIP
- 2022年ISGE指南:宫腔镜子宫肌瘤切除术(全文).docx VIP
- 2025年湖南省长沙市中考英语真题(附答案).pdf VIP
- 怎么参加展会才能获得客户.doc VIP
- 设计斜齿轮零件的机械加工工艺规程.doc VIP
- 安徽省经济潜在增长率的测算、分析与展望:基于多维度视角与实证研究.docx
- 基于大数据植入广告发展趋势研究.doc VIP
原创力文档

文档评论(0)