1. 代码如下: ($是命令行提示符) $ #目录结构 $ tree . ├── a.py └── impt.py 0 directories, 2 files # impt.py import sys import importlib from importlib.util import Lazy ...
分类:
编程语言 时间:
2021-05-25 18:05:28
阅读次数:
0
C语言 #include "stdbool.h" #define NULL ((void *)0) //Definition for a binary tree node. struct TreeNode { int val; struct TreeNode *left; struct TreeNo ...
分类:
编程语言 时间:
2021-05-25 17:51:01
阅读次数:
0
1、开放地址法 所谓的开放定址法就是一旦发生了冲突,就去寻找下一个空的散列地址,只要散列表足够大,空的散列地址总能找到,并将记录存入。 公式为:fi(key) = (f(key)+di) MOD m (di=1,2,3,……,m-1) 2、再hash法 再哈希法又叫双哈希法,有多个不同的Hash函数 ...
分类:
其他好文 时间:
2021-05-25 17:44:53
阅读次数:
0
原题链接 题意:给出 \(|s| \lesqlant 1500\) 并且给出哪些字母是好哪些是坏,然后要求求出一共有多少本质不同的字串,使得坏串个数不超过 \(k\) 个。 题解:显然可以直接 \(n^2\) 暴力找然后,用字符串 \(Hash\) 判重。 代码: #include <bits/st ...
分类:
其他好文 时间:
2021-05-24 17:09:10
阅读次数:
0
14. 最长公共前缀 class Solution { public String longestCommonPrefix(String[] strs) { if(strs.length == 0) return ""; //初始化,res为第一个字符串 String res = strs[0]; ...
分类:
其他好文 时间:
2021-05-24 16:53:00
阅读次数:
0
Redis有哪几种数据结构? ● String——字符串String数据结构是简单的key-value类型,value不仅可以是String,也可以是数字(当数字类型用Long可以表示的时候encoding就是整型,其他都存储在sdshdr当做字符串)。 ● Hash——字典在Memcached中, ...
分类:
其他好文 时间:
2021-05-24 16:31:21
阅读次数:
0
import java.util.LinkedList; import java.util.Scanner; class TreeNode{ char val; TreeNode leftchild; TreeNode rightchild; int flag;//用于后续非递归 } public ...
分类:
其他好文 时间:
2021-05-24 15:37:05
阅读次数:
0
Given a tree, you are supposed to list all the leaves in the order of top down, and left to right. Input Specification: Each input file contains one t ...
分类:
其他好文 时间:
2021-05-24 14:03:04
阅读次数:
0
需求:我在A分支上面开发了一个功能,突然B分支说也需要这个功能,但是不想要合并A分支上所有的代码;只需要合并这一个功能对应的代码 方案: 1. 在A分支上通过git log 查看日志;将自己提交的该功能对应的hash值整理出来; git log 2.如果本地没有B分支,需要先将B分支从远程仓库拉到本 ...
分类:
其他好文 时间:
2021-05-24 14:02:44
阅读次数:
0
14章进程管理 1.每个执行的程序都称一个程序,每个进程都分配一个ID(pid,进程号) 2.程序有两种方式:前台和后台 3.系统的服务都是以后台进程的方式存在,而且常驻在系统。 查看进程 ps 命令查看执行情况 ps -a 查看当前的所有进程信息 ps -u 以用户的格式显示进程信息 ps -x ...
分类:
系统相关 时间:
2021-05-24 13:42:34
阅读次数:
0