c语言 一维数组折半查找法_C程序在一维数组中查找两个最小元素

c语言 一维数组折半查找法

Problem statement: Write a C program to find two smallest elements in a one dimensional array.

问题陈述:编写一个C程序以在一维数组中找到两个最小的元素。

Example: Type1: (all the elements are not same & no of element is more than two)

示例:Type1 :(所有元素都不相同且元素不超过两个)

    Array size: 4
    Elements: 32 54 -6 43
    Output: -6 32

Example: Type2: (second minimum doesn’t exist as size of array < 2)

示例:Type2 :(由于数组的大小<2,第二个最小值不存在)

    Array size : 1
    Elements: 4
    Output: 4

Example: Type3: (all elements are same, thus only one smallest element)

示例:Type3 :(所有元素都相同,因此只有一个最小元素)

 
  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值