posts - 93,  comments - 6,  views - 57672
01 2021 档案
练习:输入二叉树结构,输出中序遍历--C语言
摘要:#include<stdio.h> #include<stdio.h> #define MaxNameLen 100 typedef struct TreeNode{ char* name; Struct TreeNode* left_child; Struct TreeNode* right_ch 阅读全文
posted @ 2021-01-02 22:49 三天乐趣 阅读(195) 评论(0) 推荐(0) 编辑
练习:亲子游戏(矩阵)--python实现
摘要:dir0=[[0,1],[1,0],[0,-1],[-1,0]] step = 999999999 tempStep = 0 tempValue = 0 def grid_input(N): grid = [[]for i in range(N)] for i in range(N): line = 阅读全文
posted @ 2021-01-02 21:36 三天乐趣 阅读(356) 评论(0) 推荐(0) 编辑
练习:已知后序遍历和中序遍历,求层次遍历--C++实现
摘要:#include<iostream> #include<vector> using namespace std; vector<char>post,in; vector<char>level(100000,-1); in N; void ergodic(int root,int start,int 阅读全文
posted @ 2021-01-02 16:14 三天乐趣 阅读(222) 评论(0) 推荐(0) 编辑
练习:求字符串中最长的表达式,并计算结果--python实现
摘要:1、判断字符串长度、最长的表达式 """ 1、所有数字,计算长度不能超过long 2、如果有多个长度一样,请返回第一个表达式结果 3、数学表达式必须要是最长的,合法的 4、操作符不能是连续的,如 +--+1是不合法的 """ import re s = input("请输入字符串:") #保留只有0 阅读全文
posted @ 2021-01-02 14:58 三天乐趣 阅读(1464) 评论(0) 推荐(0) 编辑
练习:求字符串中最小和--python实现
摘要:""" 输入字符串,判断只包含数字、a-z、A-Z、+-的数字串,进行+-,算出最小和 """ import re def sum_s(s): sum = 0 if re.match('^[0-9a-zA-Z+-]+$',s):#判断只包含数字、a-z、A-Z、+-的数字串 list1 = re.f 阅读全文
posted @ 2021-01-02 13:52 三天乐趣 阅读(831) 评论(0) 推荐(0) 编辑
练习:求最深括号深度--python实现
摘要:""" 输入字符串,判断只有括号,且括号配对,求出最深的括号深度 """ def s_true(s): sl = len(s) if sl < 1:#字符长度不能小于1 return False elif sl%2!=0:#字符长度要成双 return False c = 0 while c < s 阅读全文
posted @ 2021-01-02 12:04 三天乐趣 阅读(425) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示