校园春色亚洲色图_亚洲视频分类_中文字幕精品一区二区精品_麻豆一区区三区四区产品精品蜜桃

主頁 > 知識庫 > 好玩的vbs特色代碼vbs棧類

好玩的vbs特色代碼vbs棧類

熱門標簽:外呼系統免費招代理 怎么看地圖標注 廣州ai電銷機器人一般多少錢 合肥高德地圖標注 外呼線路中繼線是什么 外呼系統telrobot 百度地圖標注是什么意思 深圳外呼系統收費 拉薩外呼系統業務

數據結構的問題相當重要,如果你能描述出一個問題的輸入和輸出數據結構,那么這個問題就大有希望,數據結構并不是C語言的專利,真正的數據結構是偽代碼的。下面這個棧類是我以前搜集別人的代碼,實際上每當考慮一個程序問題的時候,尤其是復雜的程序,就應該想到,用什么樣的數據去描述你的輸入和輸出。

'**********************************************
'        vbs棧類
'        push(string)進棧
'        getTop取棧頂元素
'        pop去掉棧頂元素
'        isempty是否棧空
'        isfull是否棧滿(pMax設置了大小,可自行修改)
'
'        木鳥  2002.10.10
'        http://www.aspsky.net/
'**********************************************

class Stack
        private pArr, pString, pMax
        private tab
        private sub class_initialize()
                tab=chr(9)
                pMax=1000        '最大容量
        end sub
        private sub class_terminate()
                if isarray(pArr) then
                        erase pArr
                end if
        end sub

        public function push(str)
                if str>"" and instr(str,tab)1 and not Isfull then
                        if isarray(pArr) then
                                pString=join(pArr,tab)
                        end if
                        pString=pString  tab  str
                        pArr=split(pString,tab)
                        push=true
                else
                        push=false
                end if
        end function

        public function GetTop()
                if not isarray(pArr)0 then
                        GetTop=null
                else
                        if ubound(pArr)0 then
                                GetTop=null
                        else
                                GetTop=pArr(Ubound(pArr))
                        end if
                end if
        end function

        public function Pop()
                if not isArray(pArr) then
                        Pop=false
                else
                        if Ubound(pArr)0 then
                                Pop=false
                        else
                                pString=join(pArr,tab)
                                pString=left(pString,inStrRev(pString,tab)-1)
                                pArr=split(pString,tab)
                                Pop=true
                        end if
                end if
        end function

        public function Isempty()
                 if not isArray(pArr) then
                         Isempty=true
                 else
                         if Ubound(pArr)0 then
                                 isempty=true
                         else
                                 isempty=false
                         end if
                 end if
        end function

        public function Isfull()
                if not isArray(pArr) then
                        Isfull=false
                else
                        if ubound(pArr)pMax then
                                Isfull=false
                        else
                                Isfull=true
                        end if
                end if
        end function
end class

標簽:臺灣 玉林 嘉興 六安 漳州 周口 延安 廣安

巨人網絡通訊聲明:本文標題《好玩的vbs特色代碼vbs棧類》,本文關鍵詞  好玩,的,vbs,特色,代碼,棧類,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《好玩的vbs特色代碼vbs棧類》相關的同類信息!
  • 本頁收集關于好玩的vbs特色代碼vbs棧類的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 普洱| 太保市| 竹溪县| 苏州市| 上蔡县| 金平| 霍林郭勒市| 连城县| 长寿区| 潍坊市| 灌云县| 枝江市| 梁河县| 梅河口市| 巧家县| 义乌市| 平江县| 离岛区| 肥西县| 江陵县| 珠海市| 从化市| 甘德县| 天津市| 吴堡县| 德惠市| 隆化县| 陆良县| 德昌县| 都兰县| 滕州市| 盐池县| 金门县| 花莲市| 兖州市| 青铜峡市| 迁安市| 辽阳市| 淅川县| 张掖市| 环江|