-
二进制搜索 java 代码
导入 java.util.* ;类 BinarySearch{int [] ;无效的 get){扫描仪 sc = 新的 Scanner(System.in) ;System.out.println ("输入 no。元素") ;= 新 int[sc.nextInt()] ;System.out.println ("输入元素") ;为 (int 我 = 0 ; 我 < a.length;i++)a[i]=sc.nextInt() ;}int binarySearch (int n){int 低 = 0 ;int high=a.length-1 ;虽然 (低 < = 高){int 中期 =(low+high)/2 ;if(a[mid]==n)返回 (中期) ;if(n = 1 & & a [j-1] > t; j — —)[j] = [j-1] ;[j] = t ;}}空 display(){System.out.println ("给定的列表是") ;为 (int 我 = 0 ; 我 < a.length;i++)System.out.print ([i] +"") ;System.out.println() ;
- 2023-01-30 23:10:03下载
- 积分:1
-
高斯积分中的高斯点(4-80点和权数)
应用背景数值积分是科学计算中的一个重要过程,很多计算中都会用到数值积分,然而高斯-勒让德积分又是数值积分中的一种重要方法,以前在应用高斯积分时 每一次更换高斯点都要重新查找高斯点和权 现在我给出了4-80点高斯积分中的权数和高斯点 希望能为朋友们提供方便关键技术代码里面给出了 4点到80点高斯积分中的高斯点和权
- 2022-02-14 07:37:45下载
- 积分:1
-
一个求解Josephus问题的函数
#include
#include
#define NULL 0
#include
typedef struct Lnode
{
int data;
struct Lnode *next;
}Josephus;
void CreateList(Josephus*&L,int n)//建立循环链表
{
int i;
Josephus *p,*s;
s=(Josephus*)malloc(sizeof(Josephus));
s->data=1;
L=p=s;
for(i=2;idata=i;
p->next=s;
p=s;
}
p->next=L;
}
void DeleteList(Josephus*&L,Josephus*p,Josephus*q)
{
q->next=p->next;
free(p);
}
void Josephus1(Josephus*&L,int s,int m)
- 2022-01-27 23:12:59下载
- 积分:1
-
有趣的小程序(螺旋矩阵输出)
有趣的小程序(螺旋矩阵输出)-interesting little (Spiral matrix output)
- 2023-03-08 21:05:03下载
- 积分:1
-
非定常解的程序
Program for solving the unsteady one-dimensional convection/diffusion equation using FD method and various discretization schemes for convective and diffusive terms and for time integration.
- 2023-04-05 21:05:03下载
- 积分:1
-
One on the Fourier transform of the program, you can read text from your desktop
一个关于傅里叶变换的程序,可以从桌面读入文本-One on the Fourier transform of the program, you can read text from your desktop
- 2022-06-12 11:06:47下载
- 积分:1
-
约瑟夫环,运用了数据结构中的链结构。具体请详细观察源程序...
约瑟夫环,运用了数据结构中的链结构。具体请详细观察源程序-Joseph Wan, the use of the data structure in the chain structure. Please observe the specific source code
- 2022-03-09 12:41:47下载
- 积分:1
-
this mobile robot program including fuzzy control system, keypad, ultrasonic pin...
this mobile robot program including fuzzy control system, keypad, ultrasonic ping)), etc-this is mobile robot program including fuzzy control system, keypad, ultrasonic ping)), etc
- 2022-12-02 14:45:03下载
- 积分:1
-
C++编程实例
通过C++源代码全面介绍了C++程序设计的方法和技巧。作者首先假定读者并不了解程序设计的所有知识,整个程序开发过程均从原始的概念开始到程序设计的实现,从零开始意味着从最最低级的地方起步,没有任何预备知识。因此无论是对于初学C++的人,还是应用C++的高手都具有较高的实用价值。
C++初学者必看, 快速学会C++的好资料, 我就是从这个里面学会的。 例子才是经典,简单又实用。
- 2022-03-12 08:41:13下载
- 积分:1
-
数据结构中的迷宫求解
此算法是加载一个写好的迷宫,并运用此算法求解迷宫,将求解出来的迷宫道路在屏幕上显示出来。此算法简单易懂,很适合初学者想要加强数据结构的编程能力。
- 2022-07-09 11:28:48下载
- 积分:1