- 49
- 0
- 约2.28千字
- 约 6页
- 2018-02-12 发布于河南
- 举报
三个数比较大小的算法分析
三个数比较大小的算法分析景宇算法分析#第一种算法 x1=input(“input the first number:”) x2=input(“input the second number:”) x3=input(“input the third number:”) if x1=x2 and x2=x3: max=x1 elif x2=x1 and x2=x3 max=x2 else: max=x3 print(“the max is :”max) 时间复杂度O(1)空间复杂度O(1)#第二种算法 x1=input(“input the first number:”) x2=input(“input the second number:”) x3=input(“input the third number:”) if x1=x2: if x2=x3: max=x1 else: max=x3 else: if x2=x3: max=x2 else: max=x3 print(“the max is :”max) 时间复杂度O(1)空间复杂度O(1)#第三种算法(扩展为 5 个数?) x1=input(“input the first number:”) x2=input(“input the second number:”) x3=input(“
您可能关注的文档
最近下载
- 重庆大剧院建筑室内设计施工图集.pdf
- 变电站防雷及接地装置状态检修、评价导则.pdf VIP
- ISO 31000:2009 风险管理原则与实施指南(译).docx VIP
- 重力式混凝土挡土墙施工方案(完整版).pdf VIP
- (热门!)ISO 9001(DIS)-2026重大变化之3:“应对机遇”专题深度专业解读与应用指导材料(编制-2025A0).docx VIP
- 2024年中央宣传部直属单位招聘工作人员笔试真题.docx VIP
- 百度掘金名称提取考试答案-疑难题.xlsx VIP
- (高清版)DB32∕T 2074-2025 学生军训服质量评价技术规范.docx VIP
- coso企业风险管理整合框架.docx VIP
- 中国精神是兴国强国之魂 (修订).pptx VIP
原创力文档

文档评论(0)