/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), r ...
分类:
其他好文 时间:
2020-09-16 12:19:36
阅读次数:
29
今天在写二分查找,计算中间值的时候是这样写的: long mid = left + (right - left) >> 1; 然后提交一直都是超时,脑改了很多地方都不行,只能debug,发现循环死在left=16,right=30时,由于循环一直是进入left=mid+1中,然而mid根本没有变,所 ...
分类:
其他好文 时间:
2020-09-09 19:21:19
阅读次数:
59
题目 题目来源:CCF 山东省选 2008; 在线评测:Luogu#1984。 题目描述 把总质量为 $1\ \textrm$ 的水分装在 \(n\) 个杯子里,每杯水的质量均为 \(\left(\dfrac{1}{n}\right)\ \textrm{kg}\),初始温度均为 $0; ^\circ ...
分类:
其他好文 时间:
2020-09-09 18:54:43
阅读次数:
40
输入一棵二叉搜索树,将该二叉搜索树转换成一个排序的双向链表。要求不能创建任何新的结点,只能调整树中结点指针的指向。 Python # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.r ...
分类:
其他好文 时间:
2020-09-02 16:53:04
阅读次数:
42
题目 Description Little Leticija is preparing for a programming exam. Even though she has solved a lot of tasks, there’s one still left unsolved, so she ...
分类:
其他好文 时间:
2020-08-31 13:30:01
阅读次数:
65
1 /* 2 线性表的排序算法 3 cza 4 2020/7/1 5 */ 6 #include<iostream> 7 #include<stdio.h> 8 int num[100]; 9 using namespace std; 10 11 int getMix(int left,int ri ...
分类:
编程语言 时间:
2020-08-27 17:06:03
阅读次数:
59
二叉树节点函数定义: /** * Definition for a binary tree node. */ function TreeNode(val){ this.val = val; this.left = this.right = null; } 层次遍历构建二叉树(广度优先) functi ...
分类:
其他好文 时间:
2020-08-26 18:35:16
阅读次数:
74
方法一:靠浮动 ######使用浮动,先渲染左右两个元素,分别让他们左右浮动,然后再渲染中间元素,设置它的margin左右边距分别为左右两个元素的宽度。 html部分(注意:此方法中间元素必须放在最后位置!) <div class="container"> <div class="left"></d ...
分类:
Web程序 时间:
2020-08-24 16:36:30
阅读次数:
60
根据老师表(teacher),老师任课关系表(teacher2class),课程表(class),通过表连接,得到老师的任课结构表,如下: select t.id, t.name, c.title from teacher t left join teacher2class t2c on t.id ...
分类:
数据库 时间:
2020-08-24 15:13:06
阅读次数:
132
在前端开发过程中,非IE浏览器下,当容器的高度自动,并且容器内容中有浮动元素(float为left或right),此时如果容器的高度不能自适应内容的高度,从而使得内容溢出破坏整体布局,这种现象叫做浮动溢出,为了方式这个现象的发生,就需要对CSS样式进行处理,而这个过程就叫做CSS清除浮动。现在常用的 ...
分类:
Web程序 时间:
2020-08-20 19:24:01
阅读次数:
134