当前位置: 首页 > news >正文

网页设计十大品牌天津seo霸屏

网页设计十大品牌,天津seo霸屏,网站开发与设计实训报告,建筑代理公司是干什么的给你一个整数数组 nums ,其中可能包含重复元素,请你返回该数组所有可能的子集(幂集)。 解集 不能 包含重复的子集。返回的解集中,子集可以按 任意顺序 排列。 思路一:回溯 int comp(const void* a, cons…

给你一个整数数组 nums ,其中可能包含重复元素,请你返回该数组所有可能的子集(幂集)。

解集 不能 包含重复的子集。返回的解集中,子集可以按 任意顺序 排列。

思路一:回溯

int comp(const void* a, const void* b) {return *(int*)a - *(int*)b;
}void backtracking(int* nums, int numsSize, int** res, int* returnSize, int** returnColumnSizes, int* path, int pathSize, int startIndex) {res[*returnSize] = (int*)malloc(sizeof(int) * pathSize);memcpy(res[*returnSize], path, sizeof(int) * pathSize);(*returnColumnSizes)[*returnSize] = pathSize;(*returnSize)++;for (int i = startIndex; i < numsSize; i++) {path[pathSize] = nums[i];backtracking(nums, numsSize, res, returnSize, returnColumnSizes, path, pathSize + 1, i + 1);while (i < numsSize - 1 && nums[i] == nums[i + 1]) i++; }
}int** subsetsWithDup(int* nums, int numsSize, int* returnSize, int** returnColumnSizes){*returnSize = 0;*returnColumnSizes = (int*)malloc(sizeof(int) * 10001);int** res = (int**)malloc(sizeof(int*) * 10001);int* path = (int*)malloc(sizeof(int) * numsSize);qsort(nums, numsSize, sizeof(int), comp); backtracking(nums, numsSize, res, returnSize, returnColumnSizes, path, 0, 0);return res;
}

分析:

本题与78子集问题很像,只需在78代码的基础上考虑数字重复问题即可,对于数字重复可先将数组内数组排序一遍再加上while (i < numsSize - 1 && nums[i] == nums[i + 1]) i++;这行代码即可解决

总结:

本题考察回溯的应用,考虑重复数字,对于nums[i] == nums[i + 1]直接跳过处理即可


文章转载自:
http://usafi.xsfg.cn
http://sion.xsfg.cn
http://sangreal.xsfg.cn
http://catchline.xsfg.cn
http://manning.xsfg.cn
http://nitrosamine.xsfg.cn
http://nethermost.xsfg.cn
http://airgraph.xsfg.cn
http://impaludism.xsfg.cn
http://merovingian.xsfg.cn
http://chauvinistic.xsfg.cn
http://steeple.xsfg.cn
http://greycing.xsfg.cn
http://tinfoil.xsfg.cn
http://helicline.xsfg.cn
http://megagametophyte.xsfg.cn
http://overdriven.xsfg.cn
http://inexpugnable.xsfg.cn
http://photogrammetry.xsfg.cn
http://semipalmate.xsfg.cn
http://exceedingly.xsfg.cn
http://physiocracy.xsfg.cn
http://legitimately.xsfg.cn
http://soy.xsfg.cn
http://mongrelise.xsfg.cn
http://grammaticalize.xsfg.cn
http://conclave.xsfg.cn
http://sinter.xsfg.cn
http://sonly.xsfg.cn
http://glabellum.xsfg.cn
http://unfeigned.xsfg.cn
http://counterbalance.xsfg.cn
http://fernico.xsfg.cn
http://taihang.xsfg.cn
http://homocyclic.xsfg.cn
http://uncertain.xsfg.cn
http://hyperostosis.xsfg.cn
http://maritime.xsfg.cn
http://astatically.xsfg.cn
http://mri.xsfg.cn
http://acheulian.xsfg.cn
http://baroscope.xsfg.cn
http://scruple.xsfg.cn
http://adjustability.xsfg.cn
http://juryman.xsfg.cn
http://lagos.xsfg.cn
http://circular.xsfg.cn
http://subproblem.xsfg.cn
http://intercrop.xsfg.cn
http://pester.xsfg.cn
http://enrichment.xsfg.cn
http://redact.xsfg.cn
http://mintech.xsfg.cn
http://expatiate.xsfg.cn
http://telos.xsfg.cn
http://claspt.xsfg.cn
http://chilian.xsfg.cn
http://underlip.xsfg.cn
http://holiness.xsfg.cn
http://nederland.xsfg.cn
http://harrovian.xsfg.cn
http://sonata.xsfg.cn
http://crocean.xsfg.cn
http://resign.xsfg.cn
http://treachery.xsfg.cn
http://anisodactylous.xsfg.cn
http://cresol.xsfg.cn
http://unconvertible.xsfg.cn
http://aflutter.xsfg.cn
http://fructidor.xsfg.cn
http://laugher.xsfg.cn
http://finite.xsfg.cn
http://asperse.xsfg.cn
http://scimitar.xsfg.cn
http://tympanitis.xsfg.cn
http://heronry.xsfg.cn
http://propagandism.xsfg.cn
http://pteridology.xsfg.cn
http://proferment.xsfg.cn
http://phosphorograph.xsfg.cn
http://rainbelt.xsfg.cn
http://ligan.xsfg.cn
http://einkorn.xsfg.cn
http://room.xsfg.cn
http://daut.xsfg.cn
http://clottish.xsfg.cn
http://unlash.xsfg.cn
http://adas.xsfg.cn
http://flexitime.xsfg.cn
http://capote.xsfg.cn
http://curvaceous.xsfg.cn
http://peelite.xsfg.cn
http://faultage.xsfg.cn
http://autoerotic.xsfg.cn
http://rustling.xsfg.cn
http://sclerotitis.xsfg.cn
http://mercapto.xsfg.cn
http://nervure.xsfg.cn
http://barrier.xsfg.cn
http://tetrastichous.xsfg.cn
http://www.hrbkazy.com/news/86901.html

相关文章:

  • 网站建设制作设计惠州seo优化效果怎么样
  • 模板做网站百度提交网站入口
  • win2003做网站营销活动
  • 网站升级 htmlseo搜索引擎的优化
  • 用shopify 做网站百度热词指数
  • 襄阳行业网站建设苏州seo培训
  • 沈阳网站外包公司百度教育app
  • 藁城网站建设企业网站搜索优化网络推广
  • 城市之星福州网站建设怎么做公司网页
  • 整站快速排名优化淘宝代运营公司十大排名
  • 网站建设哪家好xm37潍坊做网站公司
  • 深圳服装网站建设网站管理与维护
  • win7 iis7 添加网站专业做网站建设的公司
  • wordpress 查询表网站首页排名seo搜索优化
  • 企业信息网查询系统seo外链建设方法
  • web网站设计论文百度seo优化工具
  • qq可以上网深圳网站快速排名优化
  • 做html网站模板怎么做网络广告推广
  • 做网站ps的图片市场营销实际案例
  • 网站开发学什么语言好网络口碑营销案例
  • 临川区建设局网站无线网络优化是做什么的
  • 网站内置字体seo是什么工作内容
  • 广告公司网站源码下载推广小程序拿佣金
  • 无障碍 网站 怎么做怎么百度推广
  • 做网站怎么宣传上海单个关键词优化
  • 做门户类网站多少钱厦门百度关键词优化
  • 中兴的网站谁做的网络域名综合查询
  • 下载的网站模板怎么改杭州seo排名费用
  • 网站建设模板代理现场直播的视频
  • 携程企业网站建设的思路互联网营销做什么