自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(23)
  • 收藏
  • 关注

原创 SharedPreferences 存取 json数据

SharedPreferences,json

2022-06-12 23:18:18 621 1

原创 17.电话号码的字母组合

class Solution { public List<String> letterCombinations(String digits) { List<String> result = new ArrayList<>(); String[] str = {"abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz"}; for (int i=0; i<d.

2022-02-08 22:28:38 220

原创 21. 合并俩个有序链表

class Solution { public ListNode mergeTwoLists(ListNode list1, ListNode list2) { ListNode cur = new ListNode(0); ListNode sum = cur; while (list1 != null && list2 != null) { if (list1.val < list2.val) { .

2022-01-06 00:13:26 363

原创 20. 有效的括号

class Solution { public boolean isValid(String s) { while (s.contains("()")||s.contains("{}")||s.contains("[]")){ s = s.replace("()",""); s = s.replace("{}",""); s = s.replace("[]",""); } ret.

2022-01-04 22:39:28 221

原创 19. 删除链表的倒数第 N 个结点

class Solution { public ListNode removeNthFromEnd(ListNode head, int n) { ListNode fast = head; ListNode slow = head; for(int i = 0; i < n; i++) { fast = fast.next; } if(fast == null) { .

2021-12-19 23:56:52 299

原创 15. 三数之和

class Solution { public List<List<Integer>> threeSum(int[] nums) { Arrays.sort(nums); List<List<Integer>> lists = new ArrayList<>(); for(int i = 0; i< nums.length; ++i){ if(nums[i] &.

2021-12-16 22:21:19 495

原创 5. 最长回文子串

class Solution { public static String longestPalindrome(String s) { if(s.length() == 1){ return s; } int right = 0; int left = 0; int len = 1; int maxLen = 0; int maxStart = 0; .

2021-12-13 23:32:48 138

原创 LeetCode - 每日一题 1816. 截断句子

class Solution { public String truncateSentence(String s, int k) { int count = 0; char[] p = new char[s.length()]; for(int i = 0;i<s.length();i++){ if(s.charAt(i) == ' '){ count++; } .

2021-12-06 23:37:56 475

原创 Android Studio出现Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to app

解决办法 :File -> Project Structure -> project 将gradle Version换成最新的即可

2021-12-03 02:16:37 170

原创 Caused by: org.gradle.api.GradleException: The current Gradle version 5.4.1 is not compatible with t

解决办法 :File -> Project Structure -> project 将gradle Version换成最新的即可

2021-12-03 02:10:56 2395

原创 LeetCode - 每日一题 506. 相对名次

import java.util.Arrays;import java.util.HashMap;import java.util.Map;class Solution { public String[] findRelativeRanks(int[] score) { Map<Integer,Integer> hashmap = new HashMap<>(); String rank[] = new String[score.len.

2021-12-03 00:19:51 409

原创 LeetCode - 每日一题 1446. 连续字符

class Solution { public int maxPower(String s) { int num = 1, sum = 1; for(int i = s.length()-1 ;i >0; i--) { char c = s.charAt(i); if(c == s.charAt(i - 1)) { num++; }else { .

2021-12-01 21:05:04 377

原创 3. 无重复字符的最长子串

1. class Solution {2. public int lengthOfLongestSubstring(String s) {3. int left = 0;4. int result = 0;5. HashMap<Character,Integer> hashMap = new HashMap<Character,Integer> ();6. for(int i=0; i<s.length(); i++){7. .

2021-11-29 23:53:38 384

原创 LeetCode - 每日一题 458.可怜的小猪

class Solution { public int poorPigs(int buckets, int minutesToDie, int minutesToTest) { int pigs = 0; double time = minutesToTest/minutesToDie+1; while(buckets > Math.pow(time,pigs)){ pigs++; } r.

2021-11-25 23:30:09 132

原创 2. 俩数相加

class Solution { public ListNode addTwoNumbers(ListNode l1, ListNode l2) { ListNode l3 = new ListNode(); ListNode head = l3; int carry = 0; while(l1 != null || l2 != null || carry != 0){ int val1 = l1!=nul...

2021-11-25 00:20:55 525

原创 1. 俩数之和

class Solution { public int[] twoSum(int[] nums, int target) { if(nums.length <= 1){ return null; } int[] result = new int[2]; for(int j = 0; j< nums.length-1; j++){ for(int i = nums.length-1; .

2021-11-22 23:36:30 304

原创 计算机通信网概论

一:概论计算机通信网是计算机的运算和处理功能同通信系统的信息传输功能相结合的产物1.数据通信计算机网络最基本功能是信息交换,而数据是信息的表现形式,所以数据通信是计算机通信网其他功能的基础。一个数据通信系统分为五个部分:①报文 ②数据发送者 ③数据接收者 ④传输媒体 ⑤通信协议通常我们把网络上的设备成为结点,而任意俩结点间的通信方式有三种:①:单工(通信是单方向的。一...

2019-12-15 11:39:51 726

原创 循环队列

循环队列和栈的操作基本类似 唯一要注意的点为判满条件(q-rear+1)%MAXSIZE 这里的MAXSIZE是队列开辟的最大空间。#include &lt;stdio.h&gt;#include &lt;stdlib.h&gt;typedef struct{    int arr[10];    int front;    int rear;}CSeQueue;CSeQueue...

2018-11-28 20:26:32 364

原创 栈的基本操作

#include &lt;stdio.h&gt;#include &lt;stdlib.h&gt;#define MAX 20typedef struct{    int arr[MAX];    int top;}SeqStack;SeqStack *Init(SeqStack *s){    s=(SeqStack *)malloc(sizeof(SeqStack)); ...

2018-11-28 20:03:09 90

原创 单链表的创建,查找,插入,删除操作

#include&lt;stdio.h&gt;#include&lt;malloc.h&gt;#include&lt;stdlib.h&gt;struct node{    int num;    struct node *next;};struct node *Create(){    struct node *head,*p,*q;    int x,i=2;    he...

2018-10-18 15:35:02 255

原创 教师学生登记表

#include&lt;stdio.h&gt;//教师学生登记表 #include&lt;string.h&gt; struct type {  int id;  char name[30];  char job[10];  union  {  int grade;  char position[10]; }level; }person[3]; main() {  int i,n;  pri...

2018-07-03 22:38:26 524

原创 输入一句英文句子,首个字母小写变大写

*#include&lt;stdio.h&gt;int main(){ /*char ch, str[30];//输入一段英文字母,首个字母小写变大写//  int i,flag=0; gets(str); for(i=0;(ch=str[i])!='\0';i++) { if(ch==' '||ch=='\n'||ch=='\t') flag=0; else { if(flag==0...

2018-07-03 22:36:59 1024

原创 简单:C语言连接俩个字符串

#include&lt;stdio.h&gt;connect(char str1[],char str2[],char str[]){ int i,j; for(i=0;str1[i]!='\0';i++)str[i]=str1[i]; for(j=0;str2[j]!='\0';j++)str[i+j]=str2[j]; }void main(){ char str1[50],str2[50],...

2018-06-28 21:20:45 3326

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除