码迷,mamicode.com
首页 >  
搜索关键字:binary-search 二分查找 折半查找    ( 5399个结果
实验五
// 练习:使用二分查找,在一组有序元素中查找数据项 // 形参是数组,实参是数组名 #include <stdio.h> #include <stdlib.h> const int N=5; int binarySearch(int x[], int n, int item); // 函数声明 i ...
分类:其他好文   时间:2019-12-15 18:08:51    阅读次数:59
实验五
// 练习:使用二分查找,在一组有序元素中查找数据项 // 形参是数组,实参是数组名 #include <stdio.h> #include <stdlib.h> const int N=5; int binarySearch(int x[], int n, int item); // 函数声明 i ...
分类:其他好文   时间:2019-12-15 14:49:24    阅读次数:92
实验五
实验总结:指针的使用较为困难,需要继续摸索 题目;ADEF能够正确表示数组元素a[1][2]地址 ...
分类:其他好文   时间:2019-12-15 14:17:53    阅读次数:47
实验五
Part 1 1. A Part2 1.ex2_1_1.cpp // 练习:使用二分查找,在一组有序元素中查找数据项 // 形参是数组,实参是数组名 #include <stdio.h> #include <stdlib.h> const int N=5; int binarySearch(int ...
分类:其他好文   时间:2019-12-15 12:42:31    阅读次数:83
实验五
// 练习:使用二分查找,在一组有序元素中查找数据项 // 形参是数组,实参是数组名 #include <stdio.h> #include <stdlib.h> const int N=5; int binarySearch(int x[], int n, int item); // 函数声明 i ...
分类:其他好文   时间:2019-12-15 12:25:56    阅读次数:56
实验5 数组和指针
part1 ABCDEFG part2 // 练习:使用二分查找,在一组有序元素中查找数据项 // 形参是数组,实参是数组名 #include <stdio.h> #include <stdlib.h> const int N=5; int binarySearch(int x[], int n, ...
分类:编程语言   时间:2019-12-13 19:51:38    阅读次数:105
剑指offer - 二维数组中的查找
这题我总觉得 oj 有问题。。。就算真的复杂度很高,也不可能通不过一个样例吧。。。 第一眼没注意到每一列都从上到下递增,写出来的算法平均时间复杂度为 O(lgn * lgm),最坏为O(nlgm),思路就是对第一列做二分查找得到一个行区间,然后遍历行区间,对每一行做二分查找,但提交后有段错误(本地 ...
分类:编程语言   时间:2019-12-13 14:17:36    阅读次数:87
1043 Is It a Binary Search Tree (25分)(树的插入)
A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes ...
分类:其他好文   时间:2019-12-12 19:49:32    阅读次数:100
实验五
ex2-1-1 // 练习:使用二分查找,在一组有序元素中查找数据项 // 形参是数组,实参是数组名 #include <stdio.h> #include <stdlib.h> const int N=5; int binarySearch(int x[], int n, int item); / ...
分类:其他好文   时间:2019-12-12 15:07:52    阅读次数:67
最优子序列问题(减而治之 - 二分查找 - 分组)
1 #include<stdio.h> 2 #include<stdlib.h> 3 int isSright(int *arr,int N,int M,int S);//判断S是否可能为数列分组的和 4 int dichotomy(int *arr,int N,int M);//对S的上下限使用二 ...
分类:其他好文   时间:2019-12-11 23:26:42    阅读次数:116
5399条   上一页 1 ... 52 53 54 55 56 ... 540 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!