- 1、题目 Rotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated t... 1、题目 Rotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated t...
- 题目: 求数组里面的最大值和最小值 比如:数组 1,2,3,4,5 最大值是5,最小值是1 代码实现: #include <stdio.h>int max,min;void getMaxAndMin(int a[],int n){ int *q; q=a; max=min=*a; for(q;... 题目: 求数组里面的最大值和最小值 比如:数组 1,2,3,4,5 最大值是5,最小值是1 代码实现: #include <stdio.h>int max,min;void getMaxAndMin(int a[],int n){ int *q; q=a; max=min=*a; for(q;...
- 1、题目 You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who removes the la... 1、题目 You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who removes the la...
- 1、题目 Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Input: [1,1,0,1,1,1]Output: 3Explanation: The first two digits or the last three digit... 1、题目 Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Input: [1,1,0,1,1,1]Output: 3Explanation: The first two digits or the last three digit...
- 1、题目 Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the process is like: 3 + 8 = 11... 1、题目 Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the process is like: 3 + 8 = 11...
- 1、问题 求两个字符串的最大子序列 1)、子序列和子字符串有区别,子字符串(子串)必须连续,列如 s1 = "ABCDAB" s2= "BBCDAAB" s1和s2最大子序列有"BCDA","BCDB", "CDAB","ABAB","BCAB"...,子序列BCDA是s1和s2的一个LCS s1和s2最大子字符串是... 1、问题 求两个字符串的最大子序列 1)、子序列和子字符串有区别,子字符串(子串)必须连续,列如 s1 = "ABCDAB" s2= "BBCDAAB" s1和s2最大子序列有"BCDA","BCDB", "CDAB","ABAB","BCAB"...,子序列BCDA是s1和s2的一个LCS s1和s2最大子字符串是...
- 1 问题 打印链表倒数第K个节点值。 2 代码实现 #include<stdio.h> //定义一个Node结构体,里面包含了value值和保存了下一个Node的指针(地址)typed... 1 问题 打印链表倒数第K个节点值。 2 代码实现 #include<stdio.h> //定义一个Node结构体,里面包含了value值和保存了下一个Node的指针(地址)typed...
- 1、题目 Implement int sqrt(int x). Compute and return the square root of x. Subscribe to see which companies asked this question. 2、代码实现 public class... 1、题目 Implement int sqrt(int x). Compute and return the square root of x. Subscribe to see which companies asked this question. 2、代码实现 public class...
- 题目:给定一个字符串str,求其中全部数字串所代表的数字之和 要求: 1、忽略小数点字符,例如“A1.3”,其中包括2个数字1和3 &nb... 题目:给定一个字符串str,求其中全部数字串所代表的数字之和 要求: 1、忽略小数点字符,例如“A1.3”,其中包括2个数字1和3 &nb...
- 1 问题 数组中有一个数字出现了次数超过数组长度的一半,请找出这个数字。 比如{1,2,3,2,2,2,5,4,2},我们知道这个数是2 2 分析 我们数组元素个数分为单数和双数 1)数组长度是单数的情况下 我们有5个元素,里面至少3个2,还有2个元素我们可能重复也可能不重复 我们可以定义一个计数为... 1 问题 数组中有一个数字出现了次数超过数组长度的一半,请找出这个数字。 比如{1,2,3,2,2,2,5,4,2},我们知道这个数是2 2 分析 我们数组元素个数分为单数和双数 1)数组长度是单数的情况下 我们有5个元素,里面至少3个2,还有2个元素我们可能重复也可能不重复 我们可以定义一个计数为...
- 本文目录 什么是BitmapBitmap格式它是如何存储每个像素点的如何进行压缩防止OOM 创建BitmapBitmapFactory创建BitmapFactory.Options参数详解 直接通过Bitmap创建 什么是Bitmap Bitmap是绘图中非常重要的概念,在我们前面自定义的所有View中,他们的画布Canvas说到底都其实是Bit... 本文目录 什么是BitmapBitmap格式它是如何存储每个像素点的如何进行压缩防止OOM 创建BitmapBitmapFactory创建BitmapFactory.Options参数详解 直接通过Bitmap创建 什么是Bitmap Bitmap是绘图中非常重要的概念,在我们前面自定义的所有View中,他们的画布Canvas说到底都其实是Bit...
- 1 问题 用C语言实现链表 2 代码实现 #include <stdio.h>#include <stdlib.h> #define true 0#define false -1 typedef struct Node{ int value; struct Node *next;} List; /*... 1 问题 用C语言实现链表 2 代码实现 #include <stdio.h>#include <stdlib.h> #define true 0#define false -1 typedef struct Node{ int value; struct Node *next;} List; /*...
- 1 问题 输入一个整数数组,实现一个函数来调整该数组中数字的顺序,使得所有奇数位于数组的前半部分,所有偶数位于数组的后半部分,比如数组{6、 5 、1、 4、2 、7 、3、8、9}我们调整后变成这样{9、5、1、3、7 、2 、4 、8、6} 2 分析 我们利用partiti... 1 问题 输入一个整数数组,实现一个函数来调整该数组中数字的顺序,使得所有奇数位于数组的前半部分,所有偶数位于数组的后半部分,比如数组{6、 5 、1、 4、2 、7 、3、8、9}我们调整后变成这样{9、5、1、3、7 、2 、4 、8、6} 2 分析 我们利用partiti...
- 1、题目 Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 合并2个有序链表 2、代码实现 ... 1、题目 Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 合并2个有序链表 2、代码实现 ...
- 介绍: ( deque,全名double-ended queue)是一种具有队列和栈的性质的数据结构。双端队列中的元素可以从两端弹出,其限定插入和删除操作在表的两端进行。 双端队列是限定插入和删除操作在表的两端进行的线性表。这两端分别称做端点1和端点2(如下图(a)所示)。也可像栈一样,可以用一个铁道转轨网络来比喻双端队列,如下图(b)所示。在实际使用中... 介绍: ( deque,全名double-ended queue)是一种具有队列和栈的性质的数据结构。双端队列中的元素可以从两端弹出,其限定插入和删除操作在表的两端进行。 双端队列是限定插入和删除操作在表的两端进行的线性表。这两端分别称做端点1和端点2(如下图(a)所示)。也可像栈一样,可以用一个铁道转轨网络来比喻双端队列,如下图(b)所示。在实际使用中...
上滑加载中
推荐直播
-
仓颉编程语言开源创新人才培养经验分享
2025/08/06 周三 19:00-20:00
张引 -华为开发者布道师-高校教师
热情而富有活力的仓颉社区为学生的学习提供了一个充满机遇和挑战的平台。本次直播探讨如何运用社区的力量帮助同学们变身为开源开发者,从而完成从学生到工程师身份的转变。
回顾中 -
“全域洞察·智控未来” ——云资源监控实战
2025/08/08 周五 15:00-16:00
星璇 华为云监控产品经理,霄图 华为云监控体验设计师,云枢 华为云可观测产品经理
本期直播深度解析全栈监控技术实践,揭秘华为云、头部企业如何通过智能监控实现业务零中断,分享高可用系统背后的“鹰眼系统”。即刻预约,解锁数字化转型的运维密码!
回顾中
热门标签