亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? priorityqueue.java

?? JAVA源代碼程序aashjkjhkjhkjhjkhkj
?? JAVA
字號(hào):
/** * * Class to implement priority queue with arrays - exception-throwing version * * written by : R. G. Garside * * first written : 10/July/96 * last rewritten : 30/July/97 * */import java.io.* ;import java.lancs.* ;public class PriorityQueue    {    private static final int MAX_BUFFER_SIZE = 100 ;    private int queueLength ;    private QueueElement[] buffer = new QueueElement[MAX_BUFFER_SIZE] ;    /**     * constructor     */    public PriorityQueue()        {        queueLength = 0 ;        // System.out.println("array implementation") ;        } // end of constructor method    /**     * initialize - initializes a PriorityQueue to empty     */    public void initialize()        {        queueLength = 0 ;        } // end of method initialize    /**     * insert - insert in the priority queue a QueueElement "d". The     *	program halts if there is no room     */    public void insert(QueueElement d) throws QueueFullException        {        // check that the queue is not full        if (isFull())	    throw new QueueFullException("'insert' in full queue") ;	        // search for the correct insertion position "i"        int i = 0 ;        while ((i < queueLength) &&               (buffer[i].getPriority() <= d.getPriority()))            i++ ;        // shuffle the data up (if necessary)        for (int j = queueLength ; j > i ; j--)            buffer[j] = buffer[j - 1] ;        // insert the item        buffer[i] = new QueueElement(d.getPriority(), d.getData()) ;        // adjust queue length        queueLength++ ;        } // end of method insert    /**     * first - return the QueueElement which is the first item in the     *     priority queue, without removing it; the program halts if     *     the queue is empty     */    public QueueElement first() throws QueueEmptyException        {        if (isEmpty())	    throw new QueueEmptyException("'first' on empty queue") ;        return new QueueElement(buffer[0].getPriority(), buffer[0].getData()) ;        } // end of method first    /**     * remove - remove the first item from the priority queue "q",     *     returning the priority "p" and data "d"; the program halts     *     if there are no items in the queue     */    public QueueElement remove() throws QueueEmptyException        {        // check for empty queue        if (isEmpty())	    throw new QueueEmptyException("'remove' from empty queue") ;        // remember the first item        QueueElement temp = buffer[0] ;        // shuffle everything else up        for (int i = 0 ; i < queueLength - 1 ; i++)            buffer[i] = buffer[i + 1] ;        // adjust the length        queueLength-- ;        // return the first item        return temp ;        } // end of method remove    /**     * length - returns the number of items in the priority queue "q"      */    public int length()        {        return queueLength ;        } // end of method length    /**     * isFull - returns TRUE if the PriorityQueue "q" is full, otherwise     *     returns FALSE.     */    public boolean isFull()        {        return queueLength == MAX_BUFFER_SIZE ;        } // end of method isFull    /**     * isEmpty - returns TRUE if the PriorityQueue "q" is empty,      *     otherwise returns FALSE.      */    public boolean isEmpty()        {        return queueLength == 0 ;        } // end of method isEmpty    /**     * main     */    public static void main(String[] args) throws IOException        {        int priority ;        String data ;        String response ;        boolean continueLoop = true ;        PriorityQueue q = new PriorityQueue() ;        QueueElement temp = new QueueElement() ;        while (continueLoop)            {            displayMenu() ;	    try {                response = BasicIo.readString().toLowerCase() ;                if (response.length() == 0)	            response = "x" ;                switch (response.charAt(0))                    {                    case '1' :                        q.initialize() ;                        System.out.println("queue initialized") ;                        break ;                    case '2' :                        BasicIo.prompt("priority? ") ;                        priority = BasicIo.readInteger() ;                        BasicIo.prompt("string to insert? ") ;                        data = BasicIo.readString() ;                        temp.setPriority(priority) ;                        temp.setData(data) ;                        q.insert(temp) ;                        System.out.print("'" + data) ;                        System.out.print("' inserted in queue with priority ") ;	                System.out.println(priority) ;                        break ;                    case '3' :                        temp = q.first() ;                        System.out.print("'" + temp.getData()) ;                        System.out.print("' at head of queue with priority ") ;	                System.out.println(temp.getPriority()) ;                        break ;                    case '4' :                        temp = q.remove() ;                        System.out.print("'" + temp.getData()) ;                        System.out.print("' removed from queue with priority ");	                System.out.println(temp.getPriority()) ;                        break ;                    case '5' :                        System.out.print("there are " + q.length()) ;		        System.out.println(" items in the queue") ;                        break ;                    case '6' :                        System.out.print("the queue is ") ;                        if (!q.isFull())                            System.out.print("not ") ;                        System.out.println("full") ;                        break ;                    case '7' :                        System.out.print("the queue is ") ;                        if (!q.isEmpty())                            System.out.print("not ") ;                        System.out.println("empty") ;                        break ;                    case '8' :                        while (true)                            {                            BasicIo.prompt("priority (0 to terminate)? ") ;                            priority = BasicIo.readInteger() ;                            if (priority == 0)                                break ;                                        BasicIo.prompt("string to insert? ") ;                            data = BasicIo.readString() ;                            temp.setPriority(priority) ;                            temp.setData(data) ;                            q.insert(temp) ;                            }                         break ;                    case '9' :                        while (!q.isEmpty())                            {                            temp = q.remove() ;                            System.out.print("'" + temp.getData()) ;                            System.out.print("' with priority ") ;                            System.out.println(temp.getPriority()) ;                            }                        System.out.println("**end of queue**") ;                        break ;                    case 'a' :	                q.print() ;	                break ;                    case 'q' :                        continueLoop = false ;                        break ;                    default :                        System.out.println("invalid response") ;	                break ;                    } // end of switch		} // end of try block	    catch (QueueFullException e)		{		System.out.println("no more room in the queue") ;		}		    catch (QueueEmptyException e)		{		System.out.println("no elements in the queue") ;		}	            if (continueLoop)	        {      	        BasicIo.prompt("press RETURN to continue ") ;                response = BasicIo.readString() ;                }            } // end of loop        System.out.println("program terminating") ;        } // end of method main    /**     * displayMenu     */    private static void displayMenu()        {        System.out.println() ;        System.out.println("Options to Exercise the Priority Queue") ;        System.out.println() ;        System.out.println("1 : initialise") ;        System.out.println("2 : insert") ;        System.out.println("3 : first") ;        System.out.println("4 : remove") ;        System.out.println("5 : length") ;        System.out.println("6 : is full") ;        System.out.println("7 : is empty") ;        System.out.println() ;        System.out.println("8 : multiple item insert") ;        System.out.println("9 : scan and empty queue") ;        System.out.println("a : print queue contents") ;        System.out.println() ;        System.out.println("q : quit") ;        } // end of method displayMenu    /**     * print     */    private void print()        {        System.out.println("the queue is (highest priority first)") ;        for (int i = 0 ; i < queueLength ; i++)            {            System.out.print(i) ;            System.out.print(": priority = " + buffer[i].getPriority()) ;            System.out.print(": data = '" + buffer[i].getData()) ;            System.out.println("'") ;            }        } // end of method print    } // end of class PriorityQueue

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
美腿丝袜亚洲三区| 亚洲精品老司机| 久久精品免费观看| 欧美一级xxx| 久久99久久久欧美国产| 久久久久一区二区三区四区| 狠狠色综合色综合网络| 久久精品欧美一区二区三区麻豆| 国产一区二区视频在线播放| 欧美韩国日本综合| 色综合久久99| 日韩激情中文字幕| 精品国产乱子伦一区| 国产99久久久精品| 亚洲女与黑人做爰| 欧美日韩国产一区二区三区地区| 天堂一区二区在线| 国产午夜精品一区二区| 色激情天天射综合网| 视频一区中文字幕| 久久精品综合网| 欧美性猛交xxxxxx富婆| 久久国产尿小便嘘嘘尿| 中文字幕在线一区| 在线播放亚洲一区| 成人免费三级在线| 日韩二区三区四区| 亚洲国产精品99久久久久久久久| 欧美性淫爽ww久久久久无| 久久精品二区亚洲w码| 中文字幕在线播放不卡一区| 欧美裸体bbwbbwbbw| 国产精品一区一区| 亚洲福利一区二区| 国产精品色呦呦| 7777女厕盗摄久久久| 成人综合在线观看| 日韩成人免费电影| 亚洲欧洲色图综合| 日韩视频永久免费| 91精彩视频在线| 狠狠色丁香久久婷婷综| 一区二区三区在线免费视频| 久久欧美中文字幕| 欧美老人xxxx18| 99国产精品视频免费观看| 麻豆精品一二三| 亚洲福利电影网| √…a在线天堂一区| 欧美www视频| 欧美日韩精品免费观看视频| 成人午夜视频免费看| 麻豆中文一区二区| 亚洲成在人线免费| 自拍偷拍欧美精品| 国产日韩欧美a| 亚洲精品在线三区| 91精品国产日韩91久久久久久| 色系网站成人免费| 成人99免费视频| 国产成人丝袜美腿| 精品一区二区三区欧美| 亚洲狠狠爱一区二区三区| 成人免费在线视频观看| 欧美激情在线一区二区三区| 精品日本一线二线三线不卡| 欧美蜜桃一区二区三区 | 美女网站在线免费欧美精品| 亚洲一区二区影院| 亚洲激情图片小说视频| 综合久久给合久久狠狠狠97色| 欧美激情一区二区| 中文字幕乱码亚洲精品一区| 久久精品在线免费观看| 国产亚洲午夜高清国产拍精品| 精品剧情在线观看| 日韩欧美中文字幕一区| 欧美一级二级三级乱码| 欧美一区二区三区啪啪| 日韩网站在线看片你懂的| 欧美一区二区女人| 日韩亚洲电影在线| 日韩精品一区二区三区三区免费| 欧美一级二级三级蜜桃| 久久综合精品国产一区二区三区 | 蜜桃精品视频在线观看| 视频在线在亚洲| 日韩一区精品字幕| 麻豆精品视频在线观看视频| 麻豆国产精品官网| 精品制服美女丁香| 国产乱子轮精品视频| 国产福利电影一区二区三区| 国产成人精品一区二区三区四区| 国产99久久久国产精品潘金网站| 国产一区二区三区在线观看精品 | 国产精品一区免费视频| 国产成人精品影视| 99精品视频在线播放观看| 色综合天天性综合| 欧美色图12p| 精品国产欧美一区二区| 国产精品免费观看视频| 亚洲男人都懂的| 三级不卡在线观看| 激情综合色播激情啊| 成人免费毛片高清视频| 色婷婷激情综合| 91精品婷婷国产综合久久| 久久综合久久综合九色| 国产精品美女久久福利网站| 亚洲欧洲制服丝袜| 另类小说视频一区二区| 不卡视频一二三| 欧美精选午夜久久久乱码6080| 日韩精品一区二区三区四区视频| 国产精品乱码一区二区三区软件| 亚洲一区二区三区在线看| 免费亚洲电影在线| 99这里都是精品| 日韩一区二区视频| 国产精品久久久久久久久晋中 | 国产精品欧美经典| 亚洲第一福利视频在线| 国产精品99久| 欧美人妇做爰xxxⅹ性高电影| 国产日韩精品一区| 亚洲va欧美va人人爽| 成人黄色电影在线| 91精品国产一区二区三区| 国产精品免费网站在线观看| 日本欧美大码aⅴ在线播放| 成人av在线一区二区| 宅男在线国产精品| 亚洲少妇30p| 国产精品影视网| 91精品国产欧美一区二区18| 综合欧美亚洲日本| 国产精品一区在线| 7777精品伊人久久久大香线蕉完整版| 国产精品国产成人国产三级| 极品尤物av久久免费看| 欧美另类久久久品| 一区二区三区免费观看| 成人18精品视频| 久久久国产精品不卡| 日本不卡一区二区| 91国偷自产一区二区开放时间 | 黑人巨大精品欧美一区| 精品视频在线视频| 亚洲欧洲精品成人久久奇米网| 精品一区二区三区免费视频| 欧美精三区欧美精三区| 一区二区三区日韩在线观看| 不卡视频一二三| 欧美国产精品一区二区三区| 国产一区二区视频在线| 日韩欧美国产综合| 免费成人在线视频观看| 欧美日韩一本到| 亚洲一区二区美女| 色999日韩国产欧美一区二区| 国产精品久久久久影视| 国产成人一级电影| 久久精品视频在线看| 激情综合五月婷婷| 欧美精品一区二区三区高清aⅴ | 一区二区三区国产| 91麻豆视频网站| 亚洲色图制服诱惑 | 99视频精品在线| 国产精品福利电影一区二区三区四区 | 日韩福利视频导航| 欧美一级黄色片| 久久国产乱子精品免费女| 亚洲精品一区二区三区精华液 | 欧美中文字幕一区| 一区二区三区在线视频观看58| 色婷婷精品大视频在线蜜桃视频| 一区二区三区中文字幕| 在线看日本不卡| 日韩精品电影一区亚洲| 日韩免费观看高清完整版| 激情综合网最新| 国产欧美日韩在线视频| 成人蜜臀av电影| 一区二区三区在线观看动漫| 欧美午夜精品一区二区三区| 肉色丝袜一区二区| 久久亚洲精精品中文字幕早川悠里| 国产福利一区二区三区| 国产精品久久二区二区| 欧洲国产伦久久久久久久| 天天综合天天做天天综合| 日韩色在线观看| 成人性视频免费网站| 亚洲高清久久久| 久久―日本道色综合久久| 成人激情免费网站| 亚洲国产视频网站|