- 1、题目 Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you im... 1、题目 Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you im...
- 问题描述: 要在8*8的国际象棋棋盘中放8个皇后,使任意两个皇后都不能互相吃掉。规则是皇后能吃掉同一行、同一列、同一对角线的棋子。如下图即是两种方案: 思路: 比如我们搞个数组,数组的下表表示多少行,然后数值表示多少列,比如a[4] = 5,意思就代表第四行,第五列 首先看不再同一行、同一列、同一对问题,我们数组依次增大,所以不会同... 问题描述: 要在8*8的国际象棋棋盘中放8个皇后,使任意两个皇后都不能互相吃掉。规则是皇后能吃掉同一行、同一列、同一对角线的棋子。如下图即是两种方案: 思路: 比如我们搞个数组,数组的下表表示多少行,然后数值表示多少列,比如a[4] = 5,意思就代表第四行,第五列 首先看不再同一行、同一列、同一对问题,我们数组依次增大,所以不会同...
- 假设有男人和女人两种元素,要分别打印出他们在不同状态时的不同表现。 用OO的思想把表现(行为)提取出来作为一个抽象方法,代码如下: 用if-else对状态进行判断 Person接口 public interface Person { public void action(String st... 假设有男人和女人两种元素,要分别打印出他们在不同状态时的不同表现。 用OO的思想把表现(行为)提取出来作为一个抽象方法,代码如下: 用if-else对状态进行判断 Person接口 public interface Person { public void action(String st...
- 1 问题 比如我们要遍历字符串数组,我们的思路一般是先求字符串数组的长度,然后再用for循环便利,其实没必要这样,我们直接在 字符串数组后面加上个NULL就行再去遍历 2 代码实现 #include <stdio.h... 1 问题 比如我们要遍历字符串数组,我们的思路一般是先求字符串数组的长度,然后再用for循环便利,其实没必要这样,我们直接在 字符串数组后面加上个NULL就行再去遍历 2 代码实现 #include <stdio.h...
- 1、题目 You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1's elements in the corr... 1、题目 You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1's elements in the corr...
- 前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家。点击跳转到教程 1 数组的本质 数组是多个元素的集合,在内存中分布在地址相连的单元中,所以可以通过其下标访问不同单元的元素。 2 指针。 指针也是一种变量,只不过它的内存单元中保存的是一个标识其他位置... 前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家。点击跳转到教程 1 数组的本质 数组是多个元素的集合,在内存中分布在地址相连的单元中,所以可以通过其下标访问不同单元的元素。 2 指针。 指针也是一种变量,只不过它的内存单元中保存的是一个标识其他位置...
- 1 、插入排序的详解 从第二个数字开始插入在之前的有有序系列中,直到末尾。 比如有个数组 int a[5] = {2, 5, 3, 1, 4}; 第 一次排序为:2, 5 ,3,1, 4 &nb... 1 、插入排序的详解 从第二个数字开始插入在之前的有有序系列中,直到末尾。 比如有个数组 int a[5] = {2, 5, 3, 1, 4}; 第 一次排序为:2, 5 ,3,1, 4 &nb...
- 1 问题 反转链表,比如0->1->2->3反转后变成了3->2->1->0 2 分析 搞3个指针,初始化一个指针,让头结点指向这里,然后另外一个指针初始化为NULL,然后让第一个节点指向这里,然后头结点依次... 1 问题 反转链表,比如0->1->2->3反转后变成了3->2->1->0 2 分析 搞3个指针,初始化一个指针,让头结点指向这里,然后另外一个指针初始化为NULL,然后让第一个节点指向这里,然后头结点依次...
- public class DLNode implements Node{ private Object elements; private DLNode pre; private DLNode next; public DLNode(){} public DLNode(Object elements, DLNode pre, DLNode ne... public class DLNode implements Node{ private Object elements; private DLNode pre; private DLNode next; public DLNode(){} public DLNode(Object elements, DLNode pre, DLNode ne...
- 1、题目 Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1. Examples: s = "leetcode"return 0. s = "loveleetcode",return ... 1、题目 Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1. Examples: s = "leetcode"return 0. s = "loveleetcode",return ...
- 前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家。点击跳转到教程 1.概述 C 语言包含的数据类型如下图所示 2.各种数据类型介绍 2.1整型 整形包括短整型、整形和长整形。 2.1.1短整形 short a=1; 2.1.2整形 一般占4个字节(32位),最高位... 前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家。点击跳转到教程 1.概述 C 语言包含的数据类型如下图所示 2.各种数据类型介绍 2.1整型 整形包括短整型、整形和长整形。 2.1.1短整形 short a=1; 2.1.2整形 一般占4个字节(32位),最高位...
- 1、题目 Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the ransom note can be constructed fro... 1、题目 Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the ransom note can be constructed fro...
- 1、指针数组 定义一个指针数组,该数组中每个元素是一个指针,每个指针指向哪里就需要程序中后续再定义 int *p[10]; 2、指向数组的指针 定义一个数组指针,该指针指向含10个元素的一维数组(数组中每个元素是int型) int (*p)[10]; 3... 1、指针数组 定义一个指针数组,该数组中每个元素是一个指针,每个指针指向哪里就需要程序中后续再定义 int *p[10]; 2、指向数组的指针 定义一个数组指针,该指针指向含10个元素的一维数组(数组中每个元素是int型) int (*p)[10]; 3...
- 1、问题 把参数字符串中字符反向排序,请使用指针而不是数组下标,不要使用任何C函数库中 2、实现 #include <stdio.h>#include <stdlib.h>/** * *函数把参数字符串中字符反向排序,请使用指针而不是数组下标,不要使用任何C函数库中 *用于操作字符串的函数. */void re... 1、问题 把参数字符串中字符反向排序,请使用指针而不是数组下标,不要使用任何C函数库中 2、实现 #include <stdio.h>#include <stdlib.h>/** * *函数把参数字符串中字符反向排序,请使用指针而不是数组下标,不要使用任何C函数库中 *用于操作字符串的函数. */void re...
- 1、题目 Given a word, you need to judge whether the usage of capitals in it is right or not. We define the usage of capitals in a word to be right when one of the following cases hol... 1、题目 Given a word, you need to judge whether the usage of capitals in it is right or not. We define the usage of capitals in a word to be right when one of the following cases hol...
上滑加载中
推荐直播
-
华为云码道Agent集成与鸿蒙实战2026/08/11 周二 19:00-21:00
王一男-华为云码道产品规划专家;李炎-华为云码道产品专家;彭江敏-华为云鸿蒙端云一体化开发专家
本次直播带你解读华为云码道7月份产品新特性、新功能。更有专家演示码道Agent Space × 钉钉机器集成实战,从0到1打通消息通道;码道鸿蒙端云一体化实战,快速搭建员工签到系统。
回顾中 -
华为云开发者AI素养直播课·第五期2026/09/04 周五 16:00-18:00
林华鼎-华为云AI开发者运营负责人;蒋春阳-华为云AI开发者案例开发专家
本期直播内容: AI工具体验营 · 第5-8课连讲。Agent-Team 多智能体协作完成毕业设计实践
回顾中 -
华为云开发者AI素养ClassRoom·第六期2026/09/08 周二 19:00-20:00
樊渊-2026华为软件挑战赛冠军
高手来了:看软挑高手解析二维排样问题—从工业难题到算法突破
回顾中
热门标签