效果图 功能 实现bar左右拖拽 左侧:js通过width控制 :style="{width: lwidth}" 右侧:盒子设置定位position,js通过的left来控制,同时样式需要设置 right: 0; bottom: 0; 才会出现width 中间:设置定位position,使用calc ...
分类:
其他好文 时间:
2020-06-24 19:53:14
阅读次数:
108
1、html <div class="cardBox" v-for="(item,idx) in arr" :key="idx"> <div class="cart-left"> <div class="cart-left-head"> <h3>{{item.name}}</h3> </div> < ...
分类:
其他好文 时间:
2020-06-24 17:57:41
阅读次数:
206
操作给定的二叉树,将其变换为源二叉树的镜像 /** public class TreeNode { int val = 0; TreeNode left = null; TreeNode right = null; public TreeNode(int val) { this.val = val; ...
分类:
其他好文 时间:
2020-06-24 16:08:47
阅读次数:
42
package arrays /** * https://www.hackerrank.com/challenges/ctci-array-left-rotation/problem * * A left rotation operation on an array shifts each of t ...
分类:
其他好文 时间:
2020-06-24 16:08:32
阅读次数:
49
思路:维护一个最多有K个0存在的滑动窗口,用窗口中的元素数量(该窗口中所有0都可以变成1)更新答案。 因此,统计【0,i】区间内0的数量,到下标i的映射。i作为滑动窗口的右端点, 通过以下方式计算出滑动窗口的左端点,进而得到窗口内元素的数量(right - left + 1, 闭区间[left, r ...
分类:
其他好文 时间:
2020-06-24 14:15:40
阅读次数:
47
中序遍历排序 思路: ①按中序遍历树 ②确定交换的元素x,y ③再次遍历树,改变对应节点的值 代码: # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right ...
分类:
其他好文 时间:
2020-06-24 12:15:25
阅读次数:
53
递归 思路: 递归判断根节点,左子树,右子树是否相同。 代码: # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # se ...
分类:
其他好文 时间:
2020-06-24 11:53:19
阅读次数:
63
fun hammingWeight(n: Int): Int { /** * 以下是完整的位运算符(只用语Int和Long) shl(bits) – 有符号左移(signed shift left,相当于Java的<<) shr(bits) – 有符号右移(signed shift right,相当 ...
分类:
其他好文 时间:
2020-06-24 00:47:49
阅读次数:
65
智能指针的循环引用 class Node { public: shared_ptr<Node> left; shared_ptr<Node> right; Node(int v) { this->value = v; cout << "Constructor" << endl; } ~Node() ...
分类:
其他好文 时间:
2020-06-23 13:13:43
阅读次数:
90
""" 归并排序 """ from math import floor merge_list = [11, 6743, 4656, 2321, 12, 54, 876, 232] # 合并两个数据,产生一个已经排序好的新的数组 def merge(left, right): # 设定临时数组 res ...
分类:
编程语言 时间:
2020-06-22 19:18:00
阅读次数:
61