登录
首页 » 算法 » 素数环: 把从1到10这10个数摆成一个环,要求相邻的两个数的和是一个素数。 〖问题分析〗 这是一道回溯的题目。从1开始,每个空位有9种可能,每种可能加入约束...

素数环: 把从1到10这10个数摆成一个环,要求相邻的两个数的和是一个素数。 〖问题分析〗 这是一道回溯的题目。从1开始,每个空位有9种可能,每种可能加入约束...

于 2022-03-13 发布 文件大小:54.02 kB
0 192
下载积分: 2 下载次数: 1

代码说明:

素数环: 把从1到10这10个数摆成一个环,要求相邻的两个数的和是一个素数。 〖问题分析〗 这是一道回溯的题目。从1开始,每个空位有9种可能,每种可能加入约束条件即可 1.与前面所有的数不重复 2.与前一个数和为素数(最后一个和第一个也要满足)。 〖算法流程〗 1、数据初始化; 2、递归填数: 判断第J种可能是否合法; A、如果合法:填数;判断是否到达目标(10个已填完): 是,打印结果;不是,递归填下一个; B、如果不合法:选择下一种可能;-Prime Central: 1-10 from 10 the number of put this into a ring, asked the two adjacent numbers and is a prime number. 〗 〖Analysis is a retrospective this topic. From 1 year, 9 out of every space possible, each may be bound by the conditions of accession to 1. And in front of all the number of non-repetition, 2. With a few and for a prime number (the last and the first to meet). 1〗 〖algorithm processes the data to initialize 2, fill in the number of recursion: first to determine the legality of J possible A, if the legitimate: the number of Reclamation to determine whether the target (10 have been completed): Yes, print the results of not, fill in the next recursive B, if not legitimate: a possible alternative

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • A Reader Anti-collision Protocol for RFID-Enhanced Wireless Sensor Networks
    资源描述Abstract Considering rapid developments in the technologies of both radio-frequency identification (RFID) systems and wireless sensor networks (WSN), an integration of the two technologies may lead to the formation of an RFID-enhanced WSN which would possess improved functions and capabilities. In the RFID-enhanced WSN, many reader-enhanced nodes have increasingly been employed. In such networks, RFID data contains a lot of duplication, because the same tag may be read multiple times, and collision may occur among readers, while energy constraints are also a serious problem. These three could in turn cause serious problems. In this paper, we have proposed our CSMA-based algorithm since it is light, efficiently minimizes all kinds of reader collision, and eliminates the duplicate data. For this purpose, we have used a separate control channel and a tag ID forwarding mechanism with a special co
    2023-05-06 18:20:03下载
    积分:1
  • compressive sencing
    该源码主要关于压缩感知算法的实现,是在matlab软件平台上运行的,对初学者具有较好的引导作用,对压缩感知算法的理解更能进一步
    2022-06-19 04:09:04下载
    积分:1
  • matlab编写的流体计和传热程序
    matlab编写的流体计算和传热程序-Matlab calculations prepared by the fluid and heat transfer procedures
    2022-03-21 07:37:35下载
    积分:1
  • 各种排序归纳
    各种排序算法分类归纳总结,包括希尔排序,快速排序,冒泡排序,插入排序,选择排序,归并排序等。
    2022-02-25 22:08:23下载
    积分:1
  • 基于支持向量机的非线性信道盲均衡的研究
    基于支持向量机的非线性信道盲均衡算法的研究-Based on support vector machine nonlinear channel blind equalization algorithm
    2023-08-03 12:00:03下载
    积分:1
  • c语言程序百例
    c语言的经典实例,包含基础篇、数据结构篇、数值计算与趣味数学篇、图形篇和系统篇,共200个经典例子。
    2022-04-30 02:42:56下载
    积分:1
  • A星实现旅行商问题
    用A星算法实现的旅行商问题,对于状态空间图中的某个节点,如果求出了它的后继节点,则此节点为已扩展节点,而尚未求出后继节点的节点称为未扩展节点。将未扩展的节点存于一个名为OPEN的表中,而将已扩展的节点存于一个名为CLOSED的表中。
    2023-05-08 14:00:03下载
    积分:1
  • 财经类数值(finacial numerical recipes),压缩包内有pdf文件和c++源码...
    财经类数值算法(finacial numerical recipes),压缩包内有pdf文件和c++源码-Financial category numerical algorithm (Financial numerical recipes), compressed within a pdf file and c-source
    2022-05-07 13:55:22下载
    积分:1
  • 人工智能实验,野人与传教士问题的源码,vc++编译。
    人工智能实验,野人与传教士问题的源码,vc++编译。-Artificial intelligence experiments, Savage and missionaries problem code, vc++ compiler.
    2023-02-13 02:10:03下载
    积分:1
  • 快速排序,很好用,用c++编,拷贝在文本里,大家可以参考参考哦....
    快速排序算法,很好用,用c++编,拷贝在文本里,大家可以参考参考哦.-quick sort algorithm is useful, with c writers, copy in the text, one can refer to Reference oh.
    2022-04-26 15:23:24下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载