- 1、题目: Write a function that takes a string as input and returns the string reversed. Example: Given s = "hello", return "olleh". 2、代码实现: 代码实现1: public static S... 1、题目: Write a function that takes a string as input and returns the string reversed. Example: Given s = "hello", return "olleh". 2、代码实现: 代码实现1: public static S...
- 1、问题 二位字符串数组用指针数组、数组指针、二级指针打印 2、测试代码 #include <stdio.h> int main(){ char value[4][5] = {"chen", "yu", "feng", "yy"}; char *p[5]; ch... 1、问题 二位字符串数组用指针数组、数组指针、二级指针打印 2、测试代码 #include <stdio.h> int main(){ char value[4][5] = {"chen", "yu", "feng", "yy"}; char *p[5]; ch...
- 1、线性查找 比如字符串 char s[] = "chenyu"; 如果我们是线性查找的话,就是从字符‘c’依次到字符串结尾‘u’查找 2、折半查找 注意查找之前必须是有序的 比如整形数组 int a[10] = {1, 2, 7, 9, 10}; 查找数字2 我们可以定义 首和尾巴,拿需要查找的数据和 首和尾巴下表除以2这个坐标数据对比 如果这个查找的数字比... 1、线性查找 比如字符串 char s[] = "chenyu"; 如果我们是线性查找的话,就是从字符‘c’依次到字符串结尾‘u’查找 2、折半查找 注意查找之前必须是有序的 比如整形数组 int a[10] = {1, 2, 7, 9, 10}; 查找数字2 我们可以定义 首和尾巴,拿需要查找的数据和 首和尾巴下表除以2这个坐标数据对比 如果这个查找的数字比...
- 1 问题 求圆圈最后剩下的数,比如数组0, 1, 2 ,3 ,4围城一个环,我们每次去掉第三个数字,删除的前4个数字依次是2, 0, 4, 1,最后剩下的数字是3 0 ... 1 问题 求圆圈最后剩下的数,比如数组0, 1, 2 ,3 ,4围城一个环,我们每次去掉第三个数字,删除的前4个数字依次是2, 0, 4, 1,最后剩下的数字是3 0 ...
- 单链表的反转是常见的面试题目。本文总结了2种方法。 1 定义 单链表node的数据结构定义如下: class ListNode { int val; ListNode next; ListNode(int x) { val = x; next = null; }} 2 方法1:就地反转法 2.1 思路 把当前链表的下一个节点pCur插入到头结... 单链表的反转是常见的面试题目。本文总结了2种方法。 1 定义 单链表node的数据结构定义如下: class ListNode { int val; ListNode next; ListNode(int x) { val = x; next = null; }} 2 方法1:就地反转法 2.1 思路 把当前链表的下一个节点pCur插入到头结...
- 1、题目 2.美国联邦政府使用下面这些规则计算1995年每个公民的个人收入所得税: 输入大于 不超过 你的税额为 超过这个数额的部分 $0 $2335015% ... 1、题目 2.美国联邦政府使用下面这些规则计算1995年每个公民的个人收入所得税: 输入大于 不超过 你的税额为 超过这个数额的部分 $0 $2335015% ...
- 1、题目 Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. Example: Given a = 1 and b = 2, return 3. Credits: Special thanks to @fujia... 1、题目 Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. Example: Given a = 1 and b = 2, return 3. Credits: Special thanks to @fujia...
- 1、题目 Write a program that outputs the string representation of numbers from 1 to n. But for multiples of three it should output “Fizz” instead of the number and for the multiples... 1、题目 Write a program that outputs the string representation of numbers from 1 to n. But for multiples of three it should output “Fizz” instead of the number and for the multiples...
- 1、题目 Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close i... 1、题目 Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close i...
- #include <stdio.h>#include <string.h>#include <stdlib.h>#define N 10typedef struct node{ char name[20]; struct node *llink,*rlink;}stud;/*双链表的结构定义*/ /*双链表的创建*/stud * creat... #include <stdio.h>#include <string.h>#include <stdlib.h>#define N 10typedef struct node{ char name[20]; struct node *llink,*rlink;}stud;/*双链表的结构定义*/ /*双链表的创建*/stud * creat...
- 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...
上滑加载中
推荐直播
-
HDC深度解读系列 - Serverless与MCP融合创新,构建AI应用全新智能中枢2025/08/20 周三 16:30-18:00
张昆鹏 HCDG北京核心组代表
HDC2025期间,华为云展示了Serverless与MCP融合创新的解决方案,本期访谈直播,由华为云开发者专家(HCDE)兼华为云开发者社区组织HCDG北京核心组代表张鹏先生主持,华为云PaaS服务产品部 Serverless总监Ewen为大家深度解读华为云Serverless与MCP如何融合构建AI应用全新智能中枢
回顾中 -
关于RISC-V生态发展的思考2025/09/02 周二 17:00-18:00
中国科学院计算技术研究所副所长包云岗教授
中科院包云岗老师将在本次直播中,探讨处理器生态的关键要素及其联系,分享过去几年推动RISC-V生态建设实践过程中的经验与教训。
回顾中 -
一键搞定华为云万级资源,3步轻松管理企业成本2025/09/09 周二 15:00-16:00
阿言 华为云交易产品经理
本直播重点介绍如何一键续费万级资源,3步轻松管理成本,帮助提升日常管理效率!
回顾中
热门标签