<samp id="e4iaa"><tbody id="e4iaa"></tbody></samp>
<ul id="e4iaa"></ul>
<blockquote id="e4iaa"><tfoot id="e4iaa"></tfoot></blockquote>
    • <samp id="e4iaa"><tbody id="e4iaa"></tbody></samp>
      <ul id="e4iaa"></ul>
      <samp id="e4iaa"><tbody id="e4iaa"></tbody></samp><ul id="e4iaa"></ul>
      <ul id="e4iaa"></ul>
      <th id="e4iaa"><menu id="e4iaa"></menu></th>

      CS 1501代做、代寫Python/Java程序設(shè)計(jì)

      時(shí)間:2024-04-08  來(lái)源:  作者: 我要糾錯(cuò)



      Support for Assignment 4
      CS 1501
      Sherif KhattabGeneral Hints
      • You can get the number of vertices using ag.getAirports().size(), whereby 
      ag is an AirlineGraph object
      • Iterate over airports using for(String airport: ag.getAirports()){ … }
      • You can get a unique integer for each airport in the graph using the 
      ag.getAirportNo() method
      • You can retrieve the set of neighbors of an airport using 
      ag.adj(airportName)
      • To iterate over the set of neighbors: for(Route r: ag.adj(airportName)){ … }
      • You can retrieve the name of a neighboring airport using r.destination
      • You may use HashSet to instantiate Set objectsfewestStops
      • Use BFS
      • check the pseudo-code in lecture notes
      • Shortest path Source -> transit -> destination can be found by
      • shortest path source  transit
      • shortest path transit  destination
      • concatenate the two shortest paths
      • Be careful not to add transit twice to the concatenated pathConnected Components
      • Use BFS
      • You can find the pseudo-code in the lecture notesallTrips
      • Use backtracking and pruning
      • Define a recursive helper method: solve(current decision, current solution)
      • current decision  current vertex (int or String) • current solution
      • Set<ArrayList<Route>> of trips found so far
      • current path: ArrayList<Route>
      • total price so far of current path
      • number of stops so far of current path
      • destination, budget and max number of stops for comparison
      • Inside the recursive helper method:
      • if current vertex is the destination  add current path to the solution set and return
      • iterate over all possibilities (unmarked neighbors)
      • check if you can add the neighbor to the current path (total price won’t exceed budget and total number of stops won’t exceed maximum stops)
      • if so, mark neighbor, update current path, its price, and its number of stops. 
      • make a recursive call on the neighbor
      • undo changes to current path, price, and number of stops and unmark neighbor
      • mark start airport before calling solve the first timeallRoundTrips
      • Use backtracking and pruning
      • Define a recursive helper method: solve(current decision, current solution)
      • current decision  current vertex (int or String) • current solution
      • Set<ArrayList<Route>> of trips found so far
      • current path: ArrayList<Route>
      • total price so far of current path
      • number of stops so far of current path
      • budget and max number of stops for comparison
      • Inside the recursive helper method:
      • if current vertex is the source and stops so far > 0  add current path to the solution set and return
      • iterate over all possibilities (unmarked neighbors)
      • check if you can add the neighbor to the current path (total price won’t exceed budget and total number of stops won’t exceed maximum stops)
      • if so, mark neighbor, update current path, its price, and its number of stops. 
      • make a recursive call on the neighbor
      • undo changes to current path, price, and number of stops and unmark neighbor
      • Don’t mark start airport before calling solve the first time

      請(qǐng)加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp














       

      標(biāo)簽:

      掃一掃在手機(jī)打開當(dāng)前頁(yè)
    • 上一篇:代寫CSCI 2122、C++編程設(shè)計(jì)代做
    • 下一篇:代寫EECS 493、代做Java設(shè)計(jì)編程
    • 無(wú)相關(guān)信息
      昆明生活資訊

      昆明圖文信息
      蝴蝶泉(4A)-大理旅游
      蝴蝶泉(4A)-大理旅游
      油炸竹蟲
      油炸竹蟲
      酸筍煮魚(雞)
      酸筍煮魚(雞)
      竹筒飯
      竹筒飯
      香茅草烤魚
      香茅草烤魚
      檸檬烤魚
      檸檬烤魚
      昆明西山國(guó)家級(jí)風(fēng)景名勝區(qū)
      昆明西山國(guó)家級(jí)風(fēng)景名勝區(qū)
      昆明旅游索道攻略
      昆明旅游索道攻略
    • 幣安app官網(wǎng)下載 幣安app官網(wǎng)下載

      關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

      Copyright © 2023 kmw.cc Inc. All Rights Reserved. 昆明網(wǎng) 版權(quán)所有
      ICP備06013414號(hào)-3 公安備 42010502001045

      主站蜘蛛池模板: 亚洲精品无码少妇30P| 亚洲av无码潮喷在线观看| 亚洲精品久久无码av片俺去也| 亚洲AV无码成人网站在线观看| 无码人妻精品一二三区免费| 免费无码成人AV在线播放不卡| 国产精品无码亚洲精品2021| 亚洲人成人无码网www电影首页 | 日韩免费无码一区二区三区| 日韩精品中文字幕无码专区| 中文字幕无码成人免费视频 | 国产真人无码作爱免费视频| 亚洲看片无码在线视频| 久久久久亚洲精品无码系列| 免费无码又爽又黄又刺激网站| 精品多人p群无码| 免费无码又爽又刺激高潮视频 | 日韩人妻无码免费视频一区二区三区| 无码人妻精品一区二区三区东京热 | 人妻少妇看A偷人无码精品| 无码h黄动漫在线播放网站| 一本色道久久HEZYO无码| 精品无码国产自产拍在线观看蜜| 免费无码又爽又高潮视频| 亚洲AV无码专区国产乱码不卡| 少妇人妻无码精品视频app| 久久久久亚洲AV成人无码| 国产精品视频一区二区三区无码| 国内精品无码一区二区三区 | yy111111少妇影院无码| 无码人妻精品一区二区三区9厂| 亚洲av无码专区国产不乱码| 乱人伦人妻中文字幕无码| 无码一区二区三区免费视频| 无码中文字幕一区二区三区| 国产精品无码制服丝袜| 亚洲 无码 在线 专区| 超清无码熟妇人妻AV在线电影| 国产成人精品无码一区二区三区| 亚洲精品无码Av人在线观看国产| 高h纯肉无码视频在线观看|