编程介的小学生 2019-01-22 20:19 采纳率: 20.5%
浏览 452

C语言用二分查找的方式来检索字符串string,请问C语言的方式和思路

Problem Description
Everybody knows the number is saved with the binary string in the computer. Now, their have N (1 <= N <= 1000) binary strings I tell you, your task is tell me what is the most binary substring with K (1 <= K <= L) characters in the strings I give you. The length of each string is L (1 <= L <= 60). Output times of the most appearing binary substring.

Input
Each line will contain three numbers N, L, K.
Following N lines, represent N binary strings.

Output
One answer one line.

Sample Input
2 6 3
101011
110101
2 6 4
101011
110101

Sample Output
4
2

  • 写回答

2条回答 默认 最新

  • weixin_44207816 2019-01-22 21:10
    关注

    二分查找的基本思想是将所要査找的序列的中间位置的数据与所要査找的元素进行比较,如果相等,则表示査找成功,否则将以该位置为基准将所要査找的序列分为左右两部分。

    接下来根据所要査找序列的升降序规律及中间元素与所查找元素的大小关系,

    评论

报告相同问题?

悬赏问题

  • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向