10.19 27. 01矩阵 给定一个由 0 和 1 组成的矩阵,找出每个元素到最近的 0 的距离。 两个相邻元素间的距离为 1 。 输入 0 0 0 0 1 0 0 0 0 输出 0 0 0 0 1 0 0 0 0 输入 0 0 0 0 1 0 1 1 1 输出 0 0 0 0 1 0 1 2 1 ...
分类:
其他好文 时间:
2020-11-01 21:59:05
阅读次数:
15
[初级]Java开发人员最常犯的10个错误一、把数组转成ArrayList为了将数组转换为ArrayList,开发者经常会这样做:List<String>list=Arrays.asList(arr);使用Arrays.asList()方法可以得到一个ArrayList,但是得到这个ArrayList其实是定义在Arrays类中的一个私有的静态内部类。这个类虽然和java.util.A
分类:
编程语言 时间:
2020-11-01 21:40:50
阅读次数:
21
class Solution { public: ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) { auto dummy = new ListNode(-1), cur = dummy; int t = 0; while(l1 || l2 | ...
分类:
其他好文 时间:
2020-11-01 20:59:38
阅读次数:
11
collection集合 数组中存储的都是同一类型的元素,可以存储基本数据类型值,集合存储的都是对象。而且对象的类型可以不一致 迭代器 迭代:Collection集合中元素获取方法,在取出元素之前要先判断结婚证有没有元素,如果有,就把这个元素取出来,继续判断,还有就再取出来。一直把集合中的元素全取出 ...
分类:
其他好文 时间:
2020-11-01 10:38:54
阅读次数:
34
树莓派4 国内源 cat /etc/apt/sources.list deb https://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main contrib non-free rpi cat /etc/apt/sources.l ...
分类:
其他好文 时间:
2020-11-01 10:25:05
阅读次数:
16
#include <stdio.h> #include<string.h> #include<stdlib.h> //第一关代码 struct node {//此处填写代码,定义链表结点类型,包含一个存放整型数据的 成员,和一个指向下一个结点的成员 int data; struct node* ne ...
分类:
其他好文 时间:
2020-11-01 10:15:29
阅读次数:
17
内置对象方法汇总 常用内置对象的方法 String 定义,切片,长度,替换,编列..... 列表/元组 定义,使用,循环遍历...... 字典 定义,使用,循环遍历....... 集合Set 连接数据库! 各种内置模块 os,file,re,time,json....... 1. 字符串String ...
分类:
编程语言 时间:
2020-11-01 10:04:08
阅读次数:
27
ArrayList继承自AbstractList,实现了List, RandomAccess, Cloneable, java.io.Serializable接口。ArrayList内部是一个动态数组,与Java中的数组相比,它的容量能动态增长。 简述 ArrayList 是容量可变的非线程安全列表 ...
分类:
其他好文 时间:
2020-11-01 09:18:30
阅读次数:
16
from django.shortcuts import render,HttpResponsefrom app01 import models## def user_list(request):# for i in range(500):# dic = {'name':'name_%d' % i, ...
分类:
其他好文 时间:
2020-10-31 02:09:30
阅读次数:
16
内置对象的相关方法 String:定义,切片,长度,替换,查找,编列…… 元组/List(列表):定义,使用,循环遍历 字典:定义,使用,循环遍历 Set(集合): 各种内置模块:os,time,re,json, String的常用方法: 1.去除空格 str.strip():删除字符串两边的指定字 ...
分类:
编程语言 时间:
2020-10-31 02:03:25
阅读次数:
21