摘要:
实现1 /** * 替换空格 * @param s * @param re * @return */ public String replaceSpace(String s,String re ) { // write code here StringBuilder builder = new St 阅读全文
posted @ 2022-05-10 23:18
iforeverhz
阅读(818)
评论(0)
推荐(0)
摘要:
问题描述 输入一个链表的头结点,按链表从尾到头的顺序返回一个ArrayList。 解法1:反转链表 public ArrayList<Integer> printListFromTailToHead(ListNode listNode) { ArrayList<Integer> arrayList 阅读全文
posted @ 2022-05-10 23:18
iforeverhz
阅读(95)
评论(0)
推荐(0)
摘要:
只读文件系统解决 sudo mount -o rw,remount /dev/sda1 阅读全文
posted @ 2022-05-10 23:18
iforeverhz
阅读(269)
评论(0)
推荐(0)
摘要:
题目描述 输入一个整数,输出该数32位二进制表示中1的个数。其中负数用补码表示。 解法一 public int NumberOf1(int n) { int count = 0; int flag = 1; while (flag != 0){ if((n & flag) !=0){ count++ 阅读全文
posted @ 2022-05-10 23:18
iforeverhz
阅读(124)
评论(0)
推荐(0)
摘要:
import java.util.*; /** * @author iforeverhz */ public class Demo { public static void main(String[] args) { Map<String, Integer> map = new HashMap<>( 阅读全文
posted @ 2022-05-10 23:18
iforeverhz
阅读(52)
评论(0)
推荐(0)
摘要:
public class BinaryTree { // 二叉树 根节点 public TreeNode rootNode = null; // 构造函数 创建问二叉树 public BinaryTree(int[] data) { for (int i = 0; i < data.length; 阅读全文
posted @ 2022-05-10 23:18
iforeverhz
阅读(121)
评论(0)
推荐(0)
摘要:
1. 相对路径:通过相对路径不可以确定唯一资源 * 如:./index.html * 不以/开头,以.开头路径 * 规则:找到当前资源和目标资源之间的相对位置关系 * ./:当前目录 * ../:后退一级目录 2. 绝对路径:通过绝对路径可以确定唯一资源 * 如:http://localhost/c 阅读全文
posted @ 2022-05-10 23:18
iforeverhz
阅读(87)
评论(0)
推荐(0)
摘要:
乱码问题: 1. PrintWriter pw = response.getWriter();获取的流的默认编码是ISO-8859-1 2. 设置该流的默认编码 3. 告诉浏览器响应体使用的编码 @Override protected void doPost(HttpServletRequest r 阅读全文
posted @ 2022-05-10 23:18
iforeverhz
阅读(33)
评论(0)
推荐(0)
摘要:
1. 概念:代表整个web应用,可以和程序的容器(服务器)来通信 2. 获取: 1. 通过request对象获取 request.getServletContext(); 2. 通过HttpServlet获取 this.getServletContext(); 3. 功能: 1. 获取MIME类型: 阅读全文
posted @ 2022-05-10 23:18
iforeverhz
阅读(22)
评论(0)
推荐(0)
摘要:
方法:String getRealPath(String path) @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOExcept 阅读全文
posted @ 2022-05-10 23:18
iforeverhz
阅读(71)
评论(0)
推荐(0)