<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      Programming abstractions in C閱讀筆記:p181-p183

      《Programming Abstractions In C》學(xué)習(xí)第61天,p181-p183總結(jié)。

      一、技術(shù)總結(jié)

      1.linear search algorithm

      2.lexicographic order(字典順序)

      3.binary search algorithm(二分查找算法)

      /*
       * 1.二分查找也應(yīng)用了遞歸的思想。
       * 2.這里的代碼只是demo
       */
      #include <stdio.h>
      #include "strlib.h"
      
      int FindStringInSortedArray(string key, string array[], int n);
      
      static int BinarySearch(string key, string array[], int low, int high);
      
      /*
       * Function: FindStringInSortedArray
       * Usage: index = FindStringInSortedArray(key, array, n);
       * ------------------------------------------------------
       * This function searches the array looking for the specified
       * key. The argument n specifies the effective size of the
       * array, which must be sorted according to the lexicographic
       * order imposed by StringCompare. If the key is found, the
       * function returns the index in the array at which that key
       * appears. (If the key appears more that once in the array,
       * any of the matching indices may be return). If the key
       * does not exist in the array, the function returns -1. In
       * this implementation, FindStringInSortedArray is simply a
       * wrapper; all the work is done by the recursive function
       * BinarySearch.
       */
      int FindStringInSortedArray(string key, string array[], int n) {
          return BinarySearch(key, array, 0, n - 1);
      }
      
      /*
       * Function: BinarySearch
       * Usage: index = BinarySearch(key, array, low, high);
       * ---------------------------------------------------
       * This function does the work for FindStringInSortedArray.
       * The only difference is that BinarySearch takes both the
       * upper and lower limit of the search.
       */
      static int BinarySearch(string key, string array[], int low, int high) {
          int mid, cmp;
      
          if (low > high) {
              return -1;
          }
          mid = (low + high) / 2;
          cmp = StringCompare(key, array[mid]);
          if (cmp == 0) {
              return mid;
          }
          if (cmp < 0) {
              return BinarySearch(key, array, low, mid - 1);
          } else {
              return BinarySearch(key, array, mid + 1, high);
          }
      }
      
      int main() {
          int index;
          char *arr[] = {"Programming Abstractions in C", "Hello World", "C"};
          index = FindStringInSortedArray("C", arr, 3);
          printf("index is: %d", index);
          return 0;
      }
      
      

      二、英語(yǔ)總結(jié)

      1.lecicographic是什么意思?

      答:

      (1)lexicographic < lexicography: adj. of or relating lexicography(字典的)。

      (2)lexicography: lexico-("wordbook",字典) + -graphy("to write")

      2.adhere是什么意思?

      答:p182,Although most of the recursive functions you encounter are likely to adhere to this style, the definition of the recursion is actually somewhat broader。ad-("to") + haerere("to stick")。vi. to stick firmely(附著,遵循)。后面常接介詞to。

      三、參考資料

      1. 編程

      (1)Eric S.Roberts,《Programming Abstractions in C》:https://book.douban.com/subject/2003414

      2. 英語(yǔ)

      (1)Etymology Dictionary:https://www.etymonline.com

      (2) Cambridage Dictionary:https://dictionary.cambridge.org

      歡迎搜索及關(guān)注:編程人(a_codists)

      posted @ 2023-10-23 08:58  codists  閱讀(14)  評(píng)論(0)    收藏  舉報(bào)
      主站蜘蛛池模板: 久久夜色噜噜噜亚洲av| 色伦专区97中文字幕| 狠狠躁夜夜躁人人爽天天| 国产熟女一区二区三区四区| 免费人成网站免费看视频| 国产不卡精品视频男人的天堂 | 国产a在视频线精品视频下载| 蜜桃成熟色综合久久av| 免费看的一级毛片| 华人在线亚洲欧美精品| 人妻教师痴汉电车波多野结衣| 日韩精品国产二区三区| 欧美白妞大战非洲大炮| 精品人妻伦一二二区久久| 污污污污污污WWW网站免费| 一区二区不卡国产精品| 亚洲老熟女乱女一区二区| 色窝窝免费一区二区三区| 亚洲av久久精品狠狠爱av| 农村妇女野外一区二区视频| 久久天堂综合亚洲伊人HD妓女| 国产短视频一区二区三区| 国产一卡2卡三卡4卡免费网站| 国产av一区二区三区| 人妻少妇偷人精品视频| 亚洲 一区二区 在线| 一区二区国产精品精华液| 亚洲综合网中文字幕在线| 国产精品欧美福利久久| 一 级做人爱全视频在线看| 国产成人欧美一区二区三区在线| 亚洲理论电影在线观看| 中文字幕亚洲制服在线看| 东京热一精品无码av| 毛片一区二区在线看| 久久日产一线二线三线| 深夜福利资源在线观看| 国产精品视频一区不卡| 国产免费午夜福利在线播放| 国产一区韩国主播| av老司机亚洲精品天堂|