我如何同时从正面和背面搜索数组,直到我到达c#中间的数组 [英] How do I Search an array from the front and back simultaneously till i get to the middle of the Array in c#

查看:75
本文介绍了我如何同时从正面和背面搜索数组,直到我到达c#中间的数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从前后同时搜索阵列?

How do i search an Array from front and rear Simultaneously?

推荐答案

我的算法因此而来



1.填充数组

2.使用线性搜索从左右移动,同时将项目与搜索关键字进行比较。
My Algorithm Goes thus

1. Populate array
2. Use Linear Search to move from left and right while comparing the items with the search key.


这篇关于我如何同时从正面和背面搜索数组,直到我到达c#中间的数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆