{"id":16981510,"url":"https://github.com/saadbazaz/airpal","last_synced_at":"2026-05-01T03:37:46.052Z","repository":{"id":109372594,"uuid":"226921018","full_name":"SaadBazaz/AirPal","owner":"SaadBazaz","description":"AirPal, the (dummy) Flight Reservation System. Written in C++ as a Data Structures project, with a UI in QTC++.","archived":false,"fork":false,"pushed_at":"2020-10-05T18:39:55.000Z","size":7442,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-26T17:48:30.491Z","etag":null,"topics":["cpp","flight-reservation","flight-reservation-system","qt","student-project"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SaadBazaz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-09T16:50:00.000Z","updated_at":"2024-07-20T13:27:14.000Z","dependencies_parsed_at":"2023-03-10T14:00:59.796Z","dependency_job_id":null,"html_url":"https://github.com/SaadBazaz/AirPal","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaadBazaz%2FAirPal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaadBazaz%2FAirPal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaadBazaz%2FAirPal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaadBazaz%2FAirPal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SaadBazaz","download_url":"https://codeload.github.com/SaadBazaz/AirPal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244883409,"owners_count":20526027,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","flight-reservation","flight-reservation-system","qt","student-project"],"created_at":"2024-10-14T02:05:40.109Z","updated_at":"2026-05-01T03:37:41.011Z","avatar_url":"https://github.com/SaadBazaz.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"Report of Data Structures Project.\r\n\r\n\r\nClasses Used:\r\n1. Vector Class:\r\nWe have made a template vector class with a few additional functions. This vector class object is used instead of adjacency list array in the graph class which was static. Now we can add as many cities in the graph as we like.\r\n2. Date Class:\r\nThis class is used for the calculation of date related queries of the user. This class has all the relational functionalities in it. This class object is used in the vertex of the graph which is a city.\r\n3. CityNode Class:\r\nThis is the vertex of the graph class. This has members to store information like Name of City, Date of Travel, Flying time, Landing Time, Transit time, Ticket Price, Total price etc. This class also contain assignment operator overloading.\r\n4. Graph Class:\r\nThis is where the actual graph is made. This has members like Total cities, a vector of type CityNode pointer called Array, another vector of type CityNode pointer called tempallPathGraph which contains the subgraph when the user inputs the source and destination this subgraph is populated, a vector of type string called TotalCitiesStrings which contains the names of the all the cities, another vector of type integer called Prices which contains the hotel charges per day of cities stored in the TotalCitiesStrings in the same order, and name of airline.\r\n\r\nFunctions of Graph Class:   \r\n1.\tCreateGraph(string flights , string hotels)\r\nThis function takes the address of the files that needs to be read to populate the main graph. Firstly, the hotels file is opened and read and the vector Prices is filled. Secondly, the flights file is opened and read and the main graph is made here. A line is read from the file and all the information is separately send to another function called AddEgde.\r\n2.\tAddEdge(string src , Date date , string flying , string landing , int price , int totaltime  , string airline)\r\nThis functions first checks if the source is available or not in the graph if it’s not available then firstly source node is pushed into the vector and then the destination node is attached to this source node head of the linked list. If the source is present it then checks if the destination node is present or not in the linked list if not then it creates a destination node and attaches to the linked list of the source node. In terms of Time Complexity, the checking of the source node in the vector array is linear so it takes O(V) time where V being the number of vertices in the Graph already present. For checking if the destination node is present or not. It checks first if the source is present and then checks if the linked list containing the source node as head contains the destination node which takes O(V + (Edges of that vertex)).\r\n3.\tDeleteGraph(Vector\u003cCityNode*\u003e vec)\r\nThis function deletes the given graph and also deletes the vector array to free the memory. This function is used in the Destructor of Graph Class.\r\n4.\tPrintallPathwithNode(string src , string dest)\r\nThis Function Creates the subgraph mentioned in the Graph Class members explanation. This functions calls another function which recursively calls itself and if a path is made from src to dest, it is added to this subgraph. In terms of Time Complexity, it has time complexity of a little over than O(|V|^3). It depends on the total number of edges in the graph as well. \r\n\r\nPQueue Class\r\nThis is modified version of priority queue data structure. We used array based implementation. The reason to do so is because we have access to all nodes in advance.\r\nThere is no new node created at run time after priority queue is called.\r\nFunctions:\r\n1.\tPQueue(const int\u0026 capacity, Vector\u003cCityNode*\u003e allNodes, Graph\u0026 gr)\r\nThis constructor receive vector of CityNodes, it’s capacity and a graph. It traverse all nodes and discard those which points to nodes with previous day flights. It also add transit time and costs where it needs to be addes as asked in project statement. At last it sorts all nodes in ascending order according to their flight cost using bubble sort. Overall complexity of this function is O(|N|^2), where N is total number of nodes\r\n\r\n2.\tVector\u003cCityNode*\u003e costEffective(const int\u0026 N)\r\nAs nodes are sorted in ascending order in constructor. This function just return first N nodes, where N is number of nodes the user is asked for.\r\n\r\n3.\tVector\u003cCityNode*\u003e priorityAirline(const string\u0026 airline, bool\u0026 exists)\r\nThis function return all routes which uses the specified airline. If routes with that specific airline doesn’t exist, then it’ll return all routes, and ‘exists’ indicate whether routes with specific airline are found or not.\r\n\r\n4.\tVector\u003cCityNode*\u003e datePriority(Date date, bool\u0026 exists)\r\ndatePriority return routes on specific dates asked by user. If no flights were found on that date it’ll return vector of flights one day prior to specified date and one day after specified date.\r\n\r\n5.\tVector\u003cCityNode*\u003e transitLocation(const string\u0026 cityName, bool\u0026 exists)\r\nif user wants to stay on specific city. This function will return all flight’s routes with that specific city.\r\n6.\tVector\u003cCityNode*\u003e minTimePriority( )\r\nCalling this function will sort the list on basis of flight’s total time including transit time. As this function uses bubble sort it’s complexity is O(V), where V is total number of nodes.\r\n\r\n7.\tVector\u003cCityNode*\u003e specificTransitTime(const int\u0026 min, const int\u0026 max, bool\u0026 exists)\r\nThis function will search the list of all possible flight’s routes which have desired transit time. To minimize the transit time, this function can be used by  passing value 0 and upper max desired value.\r\n\r\n8.\tVector\u003cCityNode*\u003e directFlight(bool\u0026 exists)\r\nThis function will search for direct flights between source and destination. If there is no direct flight then  it’ll return all possible indirect routes. Complexity is O( R ). where R is total routes between source and destination.\r\n\r\n9.\tVector\u003cCityNode*\u003e connectingFlight(bool\u0026 exists)\r\nReturn all indirect flights for given source and destination.Complexity is O( R ). where R is total routes between source and destination.\r\n\r\n10.\tVector\u003cCityNode*\u003e costRange(const int\u0026 range, bool\u0026 exists)\r\nWhen user wants to search flights in specific cost range, i.e budget flights. This function will return all flights in that range. As this function has to traverse all routes at least once. It’s complexity is O( R ), where R is total number of flight routes.\r\n\r\nUI Construction:\r\nQueue Class:\r\nWe have made a template queue class with a few additional functions. This queue class object is used for many booking related functions (i.e. tickets will be placed in a list according to a Queue, because the flights will leave in that order).\r\nTrie:\r\nWe have constructed a Trie with Spellchecking using the Levenshtein Distance Algorithm (This algorithm is an advanced spellcheck algorithm). The Trie checks the user queries of Source and Distance and is useful in making sure the spellings are correct and accurate.\r\nQT:\r\nQT (pronounced “Cute”) is a library of useful UI-related functions and objects. We have used this library to visualize our work and bring it to life. Within it, however, we have made sure to use all concepts of Data Structures to make the work as efficient and as presentable as possible.\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaadbazaz%2Fairpal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaadbazaz%2Fairpal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaadbazaz%2Fairpal/lists"}