- 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...
- 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...
上滑加载中
推荐直播
-
华为云码道Skill实战与极速交付,智能开发全链路实战2026/07/22 周三 19:00-21:00
王一男-华为云码道产品规划专家;李炎-华为云码道产品专家;姜浩-华为云HCDG核心组成员
直播深度解读华为云码道6月产品新特性,从Skill市场安装专家技能,带你零距离体验从需求,开发,审查,重构全链路闭环的开发过程。从零构建并交付一个完整项目,让您体验从代码提交到服务上线的“极速”之旅。
回顾中 -
聚开发者之力,创具身新未来2026/07/23 周四 15:00-17:00
张豪杰/程文/王军/刘新春/黄钦开 /张晓天
本次华为云具身智能开发平台CloudRobo培训面向具身智能开发者,带您全流程体验机器人本体R2C小时级接入、环境重建与轨迹生成仿真数据生产、PB级数据管理、数据评测、模型训推、强化学习和Benchmark一键评测等功能,并体验业界主流具身模型应用。
回顾中
热门标签