题目: 解法: 1 /* 2 // Definition for a Node. 3 class Node { 4 public: 5 int val; 6 Node* left; 7 Node* right; 8 Node* next; 9 10 Node() : val(0), left(NUL ...
分类:
其他好文 时间:
2020-05-02 13:24:44
阅读次数:
79
题目: 解答: /* // Definition for a Node. class Node { public: int val; Node* left; Node* right; Node* next; Node() : val(0), left(NULL), right(NULL), next ...
分类:
其他好文 时间:
2020-05-02 13:22:22
阅读次数:
51
快速排序算法本质上是通过把一个数组划分为两个子数组,然后递归的调用自身为每一个子数组进行快速排序来实现的。 这里首先讲递归的快速排序算法。 1.递归的排序算法 public void recQuickSort(int left, int right){ if(right-left<=0){ //如果 ...
分类:
编程语言 时间:
2020-05-01 23:55:50
阅读次数:
127
/** * 荷兰国旗划分 * <p> * 给定一个数组和一个整数num,请把小于num的数放在数组的左边,把等于num的数放在数组的中间,把大于num的数放在数组的右边(不要求整体有序) */public class NetherlandFlag { /** * 荷兰国旗划分 以arr[right] ...
分类:
其他好文 时间:
2020-05-01 16:43:44
阅读次数:
60
二分查找模版 来源:公众号 labuladong 注意: int mid = left + (right - left) / 2; 这么写而不是 int mid = (left + right) >> 1; 是由于left加right可能整数溢出 public class BinarySearch ...
分类:
其他好文 时间:
2020-04-29 14:23:15
阅读次数:
50
1.css3的新特性有哪些 (1)CSS3选择器(基本、属性、伪类具体见下) (2)CSS3边框与圆角 圆角border-radius 属性:border-top-left-radius 左上角 border-top-right-radius 右上角 border-bottom-right-radi ...
分类:
Web程序 时间:
2020-04-29 00:54:20
阅读次数:
77
<template> <div> <div> <div class="switch-panel" @click="isflag" :class="{'switch-left': flag,'switch-right': !flag}"> <span class="switch-ico"></span ...
分类:
其他好文 时间:
2020-04-28 22:47:27
阅读次数:
138
第一种方法: .item{ margin-left:auto; } 第二种方法: .item{ flex: 1; text-align: right; } ...
分类:
其他好文 时间:
2020-04-28 13:24:31
阅读次数:
292
在很多应用场景中, 马尔可夫决策过程 的状态转移概率 $p(s^ {\prime}|s,a)$ 和奖励函数 $r\left( {s,a,s^{\prime}} \right)$ 都是未知的。这种情况一般需要智能体与环境交互,然后收集一些样本,然后再根据这些样本来求解最优策略,这种基于采样的学习方法称 ...
分类:
其他好文 时间:
2020-04-27 17:53:23
阅读次数:
80
#!/bin/bashPRICE=$(expr$RANDOM%1000)TIMES=0whiletruedoread-p"Enternumber:"INTletTIMES++if[$INT-eq$PRICE]thenecho"right"echo"Timesis$TIMES"exit0elif[$INT-gt$PRICE]thenecho"HIGH"elseecho"Low"fidone
分类:
其他好文 时间:
2020-04-27 15:32:28
阅读次数:
63