欢迎光临散文网 会员登陆 & 注册

c# 算法及数据结构每日练习记录_2

2023-02-07 17:30 作者:莎士比亚熊  | 我要投稿

LeeCode—算法

1.

https://leetcode.cn/problems/squares-of-a-sorted-array/description/?envType=study-plan&id=suan-fa-ru-men&plan=algorithms&plan_progress=b48xitv&orderBy=most_votes&languageTags=csharp

给你一个按 非递减顺序 排序的整数数组 nums,返回 每个数字的平方 组成的新数组,要求也按 非递减顺序 排序

2. 

https://leetcode.cn/problems/rotate-array/?envType=study-plan&id=suan-fa-ru-men&plan=algorithms&plan_progress=b48xitv

给定一个整数数组 nums,将数组中的元素向右轮转 k 个位置,其中 k 是非负数



LeeCode—数据结构

 1.

https://leetcode.cn/problems/two-sum/?envType=study-plan&id=shu-ju-jie-gou-ru-men&plan=data-structures&plan_progress=b4tf6qe

给定一个整数数组 nums 和一个整数目标值 target,请你在该数组中找出 和为目标值 target 的那 两个 整数,并返回它们的数组下标

你可以假设每种输入只会对应一个答案。但是,数组中同一个元素在答案里不能重复出现

你可以按任意顺序返回答案

2.

https://leetcode.cn/problems/merge-sorted-array/solutions/?envType=study-plan&id=shu-ju-jie-gou-ru-men&plan=data-structures&plan_progress=b4tf6qe&orderBy=most_votes

给你两个按 非递减顺序 排列的整数数组 nums1nums2,另有两个整数 mn ,分别表示 nums1nums2 中的元素数目。

请你 合并 nums2nums1 中,使合并后的数组同样按 非递减顺序 排列。

注意:最终,合并后数组不应由函数返回,而是存储在数组 nums1 中。为了应对这种情况,nums1 的初始长度为 m + n,其中前 m 个元素表示应合并的元素,后 n 个元素为 0 ,应忽略。nums2 的长度为 n


c# 算法及数据结构每日练习记录_2的评论 (共 条)

分享到微博请遵守国家法律