diff --git a/.gitignore b/.gitignore index fb7c552..1b2f460 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ # Ignore *.zip -.git diff --git a/Exam/IKT203Exam/.gitignore b/Exam/IKT203Exam/.gitignore new file mode 100644 index 0000000..5057ecf --- /dev/null +++ b/Exam/IKT203Exam/.gitignore @@ -0,0 +1,5 @@ +# Ignore Visual Studio cache +.vs/ + +# Ignore build/output directory +out/ \ No newline at end of file diff --git a/Exam/IKT203Exam/.idea/.gitignore b/Exam/IKT203Exam/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/Exam/IKT203Exam/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/Exam/IKT203Exam/.idea/.name b/Exam/IKT203Exam/.idea/.name new file mode 100644 index 0000000..b50dd3f --- /dev/null +++ b/Exam/IKT203Exam/.idea/.name @@ -0,0 +1 @@ +IKT203_Course_Assignments \ No newline at end of file diff --git a/Exam/IKT203Exam/.idea/IKT203-main.iml b/Exam/IKT203Exam/.idea/IKT203-main.iml new file mode 100644 index 0000000..f08604b --- /dev/null +++ b/Exam/IKT203Exam/.idea/IKT203-main.iml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/Exam/IKT203Exam/.idea/editor.xml b/Exam/IKT203Exam/.idea/editor.xml new file mode 100644 index 0000000..9cf688e --- /dev/null +++ b/Exam/IKT203Exam/.idea/editor.xml @@ -0,0 +1,343 @@ + + + + + \ No newline at end of file diff --git a/Exam/IKT203Exam/.idea/material_theme_project_new.xml b/Exam/IKT203Exam/.idea/material_theme_project_new.xml new file mode 100644 index 0000000..32939b5 --- /dev/null +++ b/Exam/IKT203Exam/.idea/material_theme_project_new.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/Exam/IKT203Exam/.idea/misc.xml b/Exam/IKT203Exam/.idea/misc.xml new file mode 100644 index 0000000..0b76fe5 --- /dev/null +++ b/Exam/IKT203Exam/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/Exam/IKT203Exam/.idea/modules.xml b/Exam/IKT203Exam/.idea/modules.xml new file mode 100644 index 0000000..290b5dd --- /dev/null +++ b/Exam/IKT203Exam/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Exam/IKT203Exam/.idea/vcs.xml b/Exam/IKT203Exam/.idea/vcs.xml new file mode 100644 index 0000000..b2bdec2 --- /dev/null +++ b/Exam/IKT203Exam/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Exam/IKT203Exam/CMakeLists.txt b/Exam/IKT203Exam/CMakeLists.txt new file mode 100644 index 0000000..4dd6f96 --- /dev/null +++ b/Exam/IKT203Exam/CMakeLists.txt @@ -0,0 +1,28 @@ +# Set the minimum version of CMake required to build this project. +# This ensures that older versions of CMake don't try to run with features they don't understand. +cmake_minimum_required(VERSION 3.20) + +# Define the project name. This will be the top-level name in Visual Studio. +# It also enables the C++ language (CXX). +project(IKT203_Course_Assignments LANGUAGES CXX) + +# We enforce C++17 (or C++20 if you prefer) for the entire project. +# All targets (exercises, libraries, etc.) will inherit this setting. +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + +if(MSVC) + add_compile_options("/Zc:__cplusplus") +endif() + +# This is the core of the orchestration. CMake will now step into each of these +# folders and process their own CMakeLists.txt files. +# The order matters here: we add LibExample first so that its library is +# defined before the executables that need to link to it. + +add_subdirectory(LibExample) +add_subdirectory(Submissions) +add_subdirectory(Portfolio) + +# --- End of File --- \ No newline at end of file diff --git a/Exam/IKT203Exam/CMakePresets.json b/Exam/IKT203Exam/CMakePresets.json new file mode 100644 index 0000000..b57aba8 --- /dev/null +++ b/Exam/IKT203Exam/CMakePresets.json @@ -0,0 +1,61 @@ +{ + "version": 3, + "configurePresets": [ + { + "name": "windows-base", + "hidden": true, + "generator": "Visual Studio 17 2022", + "binaryDir": "${sourceDir}/out/build/${presetName}", + "installDir": "${sourceDir}/out/install/${presetName}", + "cacheVariables": { + "CMAKE_C_COMPILER": "cl.exe", + "CMAKE_CXX_COMPILER": "cl.exe" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } + }, + { + "name": "x64-debug", + "displayName": "x64 Debug", + "inherits": "windows-base", + "architecture": { + "value": "x64", + "strategy": "external" + }, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "x64-release", + "displayName": "x64 Release", + "inherits": "x64-debug", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + }, + { + "name": "x86-debug", + "displayName": "x86 Debug", + "inherits": "windows-base", + "architecture": { + "value": "x86", + "strategy": "external" + }, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "x86-release", + "displayName": "x86 Release", + "inherits": "x86-debug", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + } + ] +} \ No newline at end of file diff --git a/Exam/IKT203Exam/DATA/city_graph.txt b/Exam/IKT203Exam/DATA/city_graph.txt new file mode 100644 index 0000000..405307b --- /dev/null +++ b/Exam/IKT203Exam/DATA/city_graph.txt @@ -0,0 +1,37 @@ +[NODES;records:=9] +Oslo +Bergen +Trondheim +Stavanger +Kristiansand +Ålesund +Molde +Bodø +Tromsø +[EDGES;records:=26] +Oslo;Bergen;450 +Bergen;Oslo;460 +Oslo;Trondheim;820 +Trondheim;Oslo;790 +Oslo;Stavanger;600 +Stavanger;Oslo;650 +Bergen;Stavanger;210 +Stavanger;Bergen;190 +Bergen;Trondheim;540 +Trondheim;Bergen;520 +Trondheim;Ålesund;220 +Ålesund;Trondheim;240 +Ålesund;Bergen;310 +Bergen;Ålesund;300 +Stavanger;Kristiansand;180 +Kristiansand;Stavanger;170 +Kristiansand;Oslo;400 +Oslo;Kristiansand;410 +Trondheim;Bodø;600 +Bodø;Trondheim;620 +Bodø;Tromsø;500 +Tromsø;Bodø;480 +Ålesund;Molde;130 +Molde;Ålesund;120 +Molde;Trondheim;260 +Trondheim;Molde;250 \ No newline at end of file diff --git a/Exam/IKT203Exam/DATA/network_graph.txt b/Exam/IKT203Exam/DATA/network_graph.txt new file mode 100644 index 0000000..e47be45 --- /dev/null +++ b/Exam/IKT203Exam/DATA/network_graph.txt @@ -0,0 +1,29 @@ +[NODES;records:=11] +WebServer +Router1 +AuthService +CacheServer +Database +APIGateway +LoadBalancer +Firewall +AnalyticsServer +BackupServer +FileServer +[EDGES;records:=16] +WebServer;Router1;4 +WebServer;AuthService;8 +WebServer;CacheServer;5 +Router1;Database;3 +Router1;LoadBalancer;2 +Router1;Firewall;7 +AuthService;Database;2 +AuthService;APIGateway;6 +CacheServer;LoadBalancer;4 +CacheServer;FileServer;3 +FileServer;BackupServer;9 +Database;AnalyticsServer;5 +APIGateway;AnalyticsServer;4 +LoadBalancer;Firewall;3 +Firewall;BackupServer;8 +AnalyticsServer;BackupServer;7 \ No newline at end of file diff --git a/Exam/IKT203Exam/DATA/random_names.txt b/Exam/IKT203Exam/DATA/random_names.txt new file mode 100644 index 0000000..deb18fd --- /dev/null +++ b/Exam/IKT203Exam/DATA/random_names.txt @@ -0,0 +1,5401 @@ +[records:=5400] +Adryan Mandel +Rayah Steinke +Jay Villa +Nisa Laskowski +Zarya Gerry +Aster Lammers +Jacquelyn Escamilla +Jayden Walker +Adna Klassen +Vita Mcelhaney +Ibrahim Brandt +Warren Case +Alasia Wargo +Maris Hallock +Khaliyah Evangelista +Edson Sackett +Saria Beech +Braysen Krieg +Conner Lindsey +Dora Glynn +Blake Gould +Reyaan Kulp +Celestine Sala +Breya Woodside +Abdurrahman Charbonneau +Terry Holbrook +Dalary Coyle +Leigh Cotten +Caitlyn Magana +Cecilia Manning +Aubriana Altman +Cleveland Parmenter +Gurleen Hagans +Ahri Gillett +Kepler Ohalloran +Sailor Bey +Elvira Nickell +Emileigh Eichelberger +Isaac Ramirez +Allyanna Swinford +Carolynn Mincey +Keylan Schreck +Ayelen Darr +Stephon Armendariz +Analee Pond +Emmeline Cartwright +Onyx Shuster +Dinah Strait +Hasan Vergara +Kaisyn Dehoyos +Shaylyn Glasser +Yetzali Moynihan +Azaan Loredo +Riaan Conroy +Damani Caesar +Domenic Cockrell +Rey Coe +Malaki Whitmore +Kaitlynn Osorio +Lavell Brogdon +Jaeda Deane +Nirvan Broadus +Lennox Mckinley +Fernando Stokes +Lynnix Peart +Alize Zayas +Mariely Harshbarger +Shmuel Guillory +Alahna Roos +Silvano Preece +Gia Barr +Reeva Heine +Lilliann Hazlett +Jadiel Colbert +Jayde Winston +Marigold Rutkowski +Jessi Durden +Marina Tang +Charlene Pence +Audra Meehan +Keeva Litchfield +Lulu Prasad +Kaliah Delvalle +Charley Ives +Ziyon Watterson +Scottlyn Lazarus +Demetrius Schmitz +Abella Rudy +Sarenity Moorer +Jewel Hurd +Cassia Wampler +Zaedyn Witcher +Aariana Baskerville +Golden Grinnell +Kaito Skeen +Braydin Schuh +Kynlee Gregg +Jaice Knecht +Zayna Rausch +Anastazia Nealy +Tevita Janik +Joanne Perea +Anabia Yowell +Neely Depalma +Codi Rubenstein +Sora Behnke +Kamryn Fair +Ronan Baxter +Damiya Egbert +Qusai Clymer +Katiana Mosely +Harleigh Busch +Beaux Correia +Felipe Engle +Evelina Tharp +Anabelle Crews +Selene Joiner +Lucianna Sisco +Krista Bunn +Elwood Lippert +Aubreigh Fabian +Rania Mcwhorter +Kaylan Abram +Karianna Bridwell +Stassi Marcos +Dartagnan Morano +Braxtyn Comstock +Tyree Boston +Kavin Hernandes +Jaelle Trigg +Braylen Valentine +Emersen Kiel +Devontae Sylvia +Kim Mckeown +Mataya Mager +Saxon Hinz +Henson Cowden +Yara Call +Reeve Viramontes +Clarke Duck +Evalynn Hirsch +Lennox Mckinley +Alajah Gaughan +Aston Elam +Zamara Laguna +Subhan Harner +Ellagrace Kale +Godric Damian +Jansen Swaim +Maverick Vaughn +Tillie Saxon +Colston Battaglia +Rylan Urban +Summer Todd +Mekhai Alessi +Zaylah Durr +Ahtziri Nilsen +Bernadette Burden +Irvin Minter +Jianna Chapin +Arman Hoyle +Brayton Beeler +Sahir Furtado +Kayleigh Stephenson +Layken Harbison +Remington Dempsey +Kaesyn Fessler +Avan Hack +Sky Hendrick +Mariam Hendrickson +Tommie Sansone +Avry Pavlik +Beckett Rodgers +Myron Whitson +Kilian Edge +Phillip Shah +Tidus Brasher +Raider Landin +Taggart Dryer +Dakota Olsen +Britton Blythe +Cristian Lamb +Xoe Binion +Vinh Casiano +Arien Chafin +Valente Brigman +Tylor Bly +Elani Jurado +TRUE Theriot +Jaceon Oreilly +Delila Fee +Kathy Branson +Aviona Lines +Malika Urias +Yasser Polley +Karin Laux +Nakai Crossman +Zion Campos +Kaylah Bruns +Rohan Lord +Jacori Hiner +Trinity Ortega +Reniyah Bengtson +Eniyah Mazzola +Anwar Collette +Molly Schwartz +Nile Schick +Jackie Martz +Maisyn Roa +Story Mckenney +Johnpaul Brinson +Aivah Blaisdell +Coleson Montez +Wren Bloom +Giorgio Minnick +Tailynn Wash +Aleeyah Staten +Naia Sander +Terrance Burrell +Kinsler Schweizer +Lori Chiu +Jeter Molloy +Carmyn Beaman +Gretel Mickey +Holly Odom +Leandre Deen +Cloud Gehrke +Aaliyah Castillo +Atharva Groom +Jeziah Mouser +Kayanna Silvas +Brenleigh Kirkham +Kent Covarrubias +Azariah Gabriel +Siana Shiver +Tidus Brasher +Lilliann Hazlett +Suleiman Zak +Taylor Daniels +Marshawn Ellington +Rosalyn Jansen +Natasha Ziegler +Gwen Kimball +Adela Bartley +Maxson Mckoy +Christopher Mitchell +Farah Chapa +Zev Barrientos +Shaye Sweatt +Kodi Shirey +Briel Mcquade +Kaydence Lefevre +Anny Marty +Divine Bounds +Amoura Mauk +Trinitee Costanzo +Alahni Bickham +Adira Salem +Anahi Locke +Stacey Derrick +Mason Galbraith +Guadalupe Kidder +Yashvi Waldner +Janey Thurber +Jariah Partida +Royce Dale +Rooney Michelson +Gabe Joe +Gillian Zhu +Alba Condon +Stephania Ton +Amilliana Windle +Jalena Saez +Olympia Oxford +Charleston Pelletier +Nora Cole +Genessis Dominick +Amelia Campbell +Leylanie Gutierres +Savanah Zheng +Conway Thurmond +Ashton Austin +Shrihan Alvis +Jean Jeter +Kristel Merz +Shelby Kissel +Aarohi Belt +Candice Searcy +Breelynn Warnock +Lyndon Orman +Emberlynn Mcduffie +Emi Augustine +Brayden Sullivan +Payzlee Hower +Amethyst Herzog +Duke Burks +Carlyn Eder +Pamela Troyer +Ramsey Nunes +Amarii Hessle +Jagger Butts +Syriah Breton +Denise Cope +Essa Vannoy +Siddhartha Gish +Kalleigh Sandstrom +Gene Luis +Sonora Curcio +Solana Tyner +Remie Mui +Kage Hard +Amina Cline +Daxx Leitch +Jayquan Straw +Parisa Vineyard +Rainey Min +Ziona Baugher +Franki Gulick +Jomar Chartier +Ailani Dowell +Brooklin Heiser +Tanya Israel +Laniyah Barbour +Kashius Brisco +Avyan Byerly +Josalyn Moats +Korben Legg +Ariza Keffer +Terron Alleyne +Leni Kennard +Deisy Bolduc +Dontay Pera +Esther Saunders +Patton Place +Maddyn Musselman +Haddon Brashear +Jasir Aronson +Gwyneth Stringer +Nala Shipley +Tevita Janik +Nayah Jaques +Miking Ciccone +Parks Juan +Jovian Billington +Winifred Garber +Tennyson Erskine +Talon Rossi +Graeson Sabin +Jeziah Mouser +Rico Ragan +Arielle Lester +Kepler Ohalloran +Yandel Fanning +Mahala Sias +Sadie Freeman +Tilly Montiel +Bosco Lieb +Tallon Stotts +Marley Patton +Arjun Shoemaker +Tristin Duggins +Matix Dalessandro +Van Dickens +Arleth Gaytan +Cartier Ehlers +Atticus Orozco +Auden Gilmer +Korbyn Ashmore +Gabby Deming +Kaeden Baron +Reyli Karns +Cristian Lamb +Santos Woodson +Finley Camacho +Lyric Olivares +Katalina Beaver +Ella Cooper +Megan Dorsey +Shakira Boardman +Saxon Hinz +Mai Kahl +Erielle Pasley +Kynadee Gorrell +Josemanuel Palmore +Rosaleigh Bedard +Hank Farris +Rachelle Robinette +Evalyn Caballero +Yuri Teel +Lindley Dear +Amellia Monzon +Novah Chronister +Tate Cisneros +Miah Rodrigues +Yusuf Madison +Evianna Bushnell +Aidyn Shiflett +Evelynn Rubio +Hadrian Rosenblatt +Shaquille Pardue +Koltin Miceli +Addison James +Destiney Rubino +Rivers Dameron +Jedidiah Bunch +Embree Chisolm +Haroon Abbey +Arius Dvorak +Jusiah Cranston +Vega Jump +Jillian Blanchard +Josemanuel Palmore +Ashley Hudson +Soleil Cohn +Kalyn Tello +Rickey Tennant +Briseis Stamps +Hubert Coen +Charissa Dice +Gabby Deming +Parth Gottlieb +Tylee Meacham +Meliah Barriga +Jeancarlo Mcanally +Adalynne Heckman +Ilias Elswick +Gretta Raya +Jean Rosenberger +Jaliyah Leal +Anibal Annis +Christy Weidner +Maylani Whyte +Ellamae Proulx +Noora Rager +Jaciel Weeden +Niklas Bennington +Minna Barto +Cayden Dennis +Kyan Mcarthur +Kate Hartman +Naomy Mather +Shaina Archibald +Serenity Schmidt +Kabir Devries +Milan Moses +Brielle Bates +Arron Arango +Coraline Hewitt +Bayne Hillis +Kalvin Batista +Jazmine Stuart +Xzander Bemis +Eira Borchardt +Alyssandra Nestor +Damani Flora +Yeray Dull +Keanna Crotty +Caspian Shull +Jamison Kaufman +Maddilynn Puentes +Keller Millard +Morghan Fudge +Zenaida Huckaby +Juniper Lynn +Frieda Barcia +Robert Ortiz +Brianne Basile +Aamina Twomey +Marjorie Geiger +Ina Bixler +Gohan Cavallaro +Donatello Winkle +Chauncey Tankersley +Aris Carraway +Juliet Aguirre +Alexavier Millan +Madina Carmack +Matilyn Barley +Kasper Risner +Finley Camacho +Kathia Krupa +Maelee Chew +Kaedyn Kimber +Ysabella Trombley +Adia Pleasant +Jaclyn Babb +Arnoldo Edmundson +Corwin Wingard +Maximino Linehan +Kiana Stacy +Liara Yip +Cal Hite +Cayla Medlin +Abbi Kania +Jozlynn Woolfolk +Keisi Duron +Kassidee Lathan +Aj Plante +Alahna Roos +Aisley Royster +Laila Luna +Anvitha Wirtz +Rooney Michelson +Easton Hammock +Teegan Laney +Zade Faison +Zofia Viola +Kaidance Nilsson +Cache Maynor +Glen Gerard +Addilynn Hollingsworth +Arsema Chitwood +Raisa Tims +Gunther Costanza +Navy Caputo +Pearl Webber +Taylar Pegram +Violeta Perdue +Milania Dodge +Quin Rubalcava +Jailee Criss +Eviana Echeverria +Blythe Ceja +Riana Mellott +Blue Bigler +Trinity Ortega +Zacarias Ignacio +Yulianna Dugas +Avrohom Greiner +Payslee Breland +Kiah Dumont +Kendrix Eberhart +Dianne Lundeen +Nataleigh Sacco +Jaslene Ashe +Jiana Guan +Servando Confer +Keysha Howze +Krish Lind +Keisy Munger +Tiffani Quijada +Kensington Ogden +Aili Sartin +Talyn Avendano +Katherin Burgin +Anika Cash +Armaan Scarborough +Callee Foxworth +Zamara Laguna +Jenika Elson +Drew Corey +Baileigh Hamblin +Josalynn Shope +Leelah Gilmartin +Jefferson Cordero +Koral Dunson +Braylin Martines +Darian Fedor +Asiyah Ballesteros +Jamar Loomis +Naisha Paulk +Nihira Spiller +Dakota Olsen +Katara Peet +Crispin Rhee +Arav Robey +Emiliano Hodges +Mackenzie Plowman +Deborah Bower +Waleed Arreguin +Robin Busby +Aida Escalante +Joey Alcantar +Hezekiah Poe +Rivka Schaffer +Dustyn Manor +Myasia Esqueda +Mick Hoss +Salomon Farber +Rhea Leung +Kelcie Quimby +Marcelino Whitworth +Saya Turney +Arabella Sherman +Elouise Behrens +Denisse Matson +Samanta Applewhite +Medina Tart +Mihir Willie +Jaydee Pillow +Mikaylah Deas +Dominick Vincent +Deklen Lafond +Lennon Stinson +Mohamedamin Ruddy +Dirk Delcastillo +Alaa Gilpin +Ivana Ryder +Heather Spaulding +Abdurrahman Charbonneau +Jaren Luster +Zuleyka Benavidez +Kansas Mcadoo +Kirah Nottingham +Masen Rincon +Bridgette Luu +Shaniya Marx +Daemon Hollinger +Spirit Marrone +Soledad Seng +Jolee Maas +Arlo Craft +Mahogany Rupert +Jadore Quillen +Rithvik Walczak +Clementine Huggins +Halley Wight +Kevon Schnell +Ambria Laurie +Huxley Dowling +Kinlee Barrow +Lillyan Denham +Jeffery Fonseca +Lamya Metzler +Aulani Pennell +Johnson Graziano +Mohamed Spence +Dany Rondeau +Avani Falcon +Jaylyn Barkley +Meir Greenfield +Aaliyah Castillo +Dmitri Casto +Jaceion Houk +Aric Rounds +Alize Zayas +Hallee Braithwaite +Broderick Lytle +Pranav Switzer +Isabelle Watkins +Ansel Main +Fallyn Nemeth +Adhvik Jacinto +Mei Cashman +Courtland Haworth +Tzipora Lacombe +Quinn Roach +Zayden Warner +Bradleigh Karim +Aiden Conyers +Aleenah Householder +Jess Gallimore +Halo Fortune +Hero Chevalier +Ianna Wilds +Analiyah Buxton +Crawford Doane +Noelia Forte +Lawrence Workman +Kiarah Humbert +Emonie Anson +Keon Halverson +Ellora Fan +Kerrington Benally +Blaine Elkins +Kiya Lieberman +Sammy Brockman +Maddex Hackney +Annie Macias +Addilyn Zamora +Kathrine Poor +Shulem Pagel +Kassie Taber +Pryce Santoyo +Rebeka Mickle +Precious Cao +Sahar Manriquez +Maryanna Turek +Bella Ryan +Kaiden Dalrymple +Kamilla Lewandowski +Hailee Browne +Maple Fazio +Kameryn Penaloza +Frederick Mackey +Aviva Gaither +Virginia Mcgowan +Tayah Laurent +Aleksey Brewton +Darion Reiss +Abubakr Cantor +Emerald Conn +Elexis Roseberry +Amarachi Barwick +Rory Mora +Alonah Hurwitz +Abbie Horvath +Elena Dean +Abel Lawrence +Christiano Hollander +Aldo Cho +Eiza Laster +Tyquan Therrien +Sari Fregoso +Audriana Eason +Auri Sanfilippo +Luqman Palomares +Rhiannon Hardwick +Kelsey Huang +Caeli Cai +Aubreanna Leboeuf +Yajaira Kantor +Kamryn Escobar +Anyssa Carlo +Jahmari Sterner +Tomas Piper +Margeaux Campuzano +Amador Balogh +Addyson Horne +Demarius Endres +Yaritza Lujan +Kemari Barros +Lane Beattie +Lamar Wyrick +Ashten Orth +Jensen Lavender +Carmela Motley +Amaya Frank +Quinn Munoz +Lakai Chauvin +Manav Brannen +Akshara Mesa +Jasiyah Stalnaker +Hershy Swick +Mirabella Mccleary +Deangelo Hutson +Sanvi Boss +Muriel Northern +Avi Betancourt +Samantha West +Quincy Herrick +Remmy Boyette +Alba Condon +Shyann Curiel +Shayaan Bunton +Sharif Vankirk +Amauri Lindell +Keaton Varghese +Keturah Gervais +Kristin Partridge +Remington Huff +Brenleigh Kirkham +Samar Rembert +Kemora Castelli +Jenesis Arnett +Tillman Revels +Jack Morris +Abdulrahman Valdivia +Brienne Weise +Alyah Hollowell +Ameen Nester +Brooklin Heiser +Leilanie Wrenn +Kyara Newland +Ozzy He +Odalis Kisner +Gina Jauregui +Damoni Camper +Kai Varela +Skilar Camden +Kacey Starnes +Safiyyah Beckford +Hadley Jensen +Jaxen Schafer +Mahir Hollenbeck +Salina Sawyers +Addelynn Lathrop +Kolbi Doster +Amor Corrales +Markeith Mathewson +Don Carbone +Jackie Martz +Susana Withers +Kynzleigh Newlin +Marlen Burd +Annaly Lambrecht +Zeena Maiden +Taylor Daniels +Quin Dahlberg +Aisha Andersen +Nazir Andrus +Eshan Siebert +Tiffany Archer +Jurgen Elia +Simona Lett +Lilah Hutchinson +Camari Gosnell +Garret Anton +Genessis Dominick +Journee Sexton +Delayza Basso +Janey Thurber +Christelle Kimura +Mea Christopherson +Abbigail Jung +Aunna Gregorio +Evah Escoto +Lisandro Chi +Georgina Wyman +Arshiya Laliberte +Raquel Self +Grant Frazier +Deanthony Judy +Kenzlie Cawley +Mariama Hensel +Maura Frias +Bobbi Lavigne +Malachai Bent +Anastasiya Millen +Tenzin Bogan +Aeden Littrell +Adalin Templin +Reagan Bynum +Danni Ridenour +Kaydee Vanmeter +Katelyn Lang +Lamarcus Mccafferty +Severin Spoon +Eli Wood +Ravenna Cripe +Kayleen Trahan +Rozalyn Cauthen +Carmyn Beaman +Yovani Jordon +Hashir Dufour +Danielle Valencia +Jaziah Mckeever +Zamarion Busse +Kynley Wiener +Jaliah Brenneman +Chevelle Beckett +Imani Odell +Loyal Olmos +Faigy Soares +Suzanne Cromwell +June Jefferson +Kaliah Delvalle +Paisleigh Marrero +Starla Gragg +Kipton Lundberg +Elizabeth Carter +Paxton Wolf +Breasia Mcmillin +Alajah Gaughan +Anish Leong +Calan Blackstone +Devora Roeder +Caine Santacruz +Mariana Dalton +Cheyenne Prince +Prince Mcfarland +Bensen Saravia +Samora Delucia +Walid Knepper +Leopold Strain +Nayeli Novak +Clarke Macpherson +Milly Wimberly +Catelynn Thoms +Yvette Clancy +Brady Reeves +Hiram Fugate +Raylan Riddle +Jahiem Resnick +Rubin Cespedes +Tiger Husband +Kavon Matta +Klaus Litton +Caysen Moe +Alanis Reinhardt +Kaeson Crossley +Estrella Goins +Elian Saucedo +Laynie Hitt +Aundrea Neese +Kalaya Mcclary +Jalynn Resendez +Kaiyah Matteson +Ilaria Morman +Jeremyah Grau +Ellen Yarbrough +Xavior Wacker +Wayne Han +Delanie Herrmann +Ace Bean +Mazie Wilde +Zamira Hixson +Karson Rivas +Holden Clayton +Javontae Otten +Eliab Slavin +Jovan Martino +Laksh Ruch +Edie Kinder +Ahlam Benham +Talen Valentino +Jax Alvarenga +Monika Fick +Kharter Isaacson +Cassia Wampler +Sage Bartlett +Ani Olguin +Aleina Harr +Kaysen Aguilera +Maiyah Ensley +Elyzabeth Heatherly +Tanvi Sanborn +Zamiyah Yarborough +Shaelyn Wilhite +Aeris Vickery +Judson Benedict +Eve Rowland +Jacey Seaman +Makena Begay +Breonna Smitherman +Aicha Braddock +Therese Baskin +Brodie Delatorre +Eveline Knuth +Pinchas Gilles +Zena Edens +Aizah Giese +Wayland Blades +Blanca Lindberg +Titus Meyers +Elara Durkee +Ellah Mumford +Seren Studer +Lariah Bunnell +Lamarion Seeger +Rianna Tseng +Saharsh Scheid +Tevita Janik +Lily Reyes +Shianne Hersey +Saw Earp +Vanya Willman +Ines Fairbanks +Lucinda Bertrand +Fatema Perrotta +Allie Serrano +Cameron Costello +Masyn Paulino +Meila Edelman +Emsley Sasser +Cotton Stiffler +Keasia Aho +Siobhan Phillip +Alekzander Baeza +Rigoberto Handley +Jayceon Ballard +Laurel Maher +Braven Folk +Rawan Murchison +Martez Ledoux +Kaia Hayden +August Erickson +Aissatou Weathersby +Mandy Mcdougal +Kale Moya +Deacon Baird +Hadlee Coates +Bernard Robert +Gloriana Drews +Tariah Fowlkes +Barrett Allison +Mackson Pitchford +Nico Downs +Inez Wessel +Yohanna Propst +Avril Levesque +Janely Mcmichael +Jourdyn Tennyson +Rhema Giddings +Ren Vuong +Niko Schumacher +Falynn Caruthers +Ruston Sealey +Kierstyn Mach +Tenley Vo +Jaselle Darlington +Chole Buckman +Zakai Leger +Henderson Basinger +Erma Strode +Adalind Frame +Ellyson Massengale +Japheth Massaro +Shifra Flake +Jaicee Fuhrman +Harris Seals +Oshea Volz +Kirill Garretson +Evy Spitzer +Amauri Broome +Aura Kaye +Jaylan Mcdaniels +Yatziry Bowler +Deetya Driskill +Charleston Pelletier +Suzette Mcgriff +Evren Swink +Dakarai Mccandless +Genaro Felts +Eugenia Korte +Laykin Moline +Macee Deering +Mackynzie Carleton +Tennessee Lebrun +Aaliya Heilman +Aylee Shults +Taylor Mercer +Axyl Broadnax +Nayely Thach +Xander Hardy +Vernon Ramon +Marlo Blessing +Bently Harkins +Eddie Hagen +Ranger Angle +Semaj Paschal +Rodolfo Ennis +Annalyn Pogue +Amara Maddox +Tanish Carcamo +Shriya Gorski +Florence Sepulveda +Samia Zhao +Jireh Banker +Herschel Frechette +Angelika Beckner +Teresa Manley +Atziri Vereen +Janice Tinsley +Brailyn Sturgis +Arie Staggs +Yaqub Rosier +Ely Mehta +Rania Mcwhorter +Raigan Obregon +Tamiyah Pigg +Guiliana Fetter +Cambria Haywood +Clarice Eicher +Lyon Carrell +Amen Chestnut +Jordin Neri +Shelbie Albarran +Bransyn Glazer +Arlett Hazard +Charley Dejesus +Caius Selby +Yazan Lawless +Angelynn Geiser +Jarell Delano +Landyn Madden +Rosalyn Jansen +Anwita Deville +Kaine Brownlee +Ivie Towns +Adilynn Siegel +Zayed Fitz +Aris Blanchette +Katheryne Dimartino +Malka Winslow +Madison Beale +Tegan Aguayo +Ena Wortham +Dino Rusk +Kennadie Trainer +Rosa Pike +Donte Wing +Queenie Delia +Eastyn Valente +Khaleesi Steward +Kofi Canas +Ellyana Spooner +Darrius Easterling +Bradley Lowe +Kyree Perron +Damario Hermes +Hollis Mcclelland +Ryla Doud +Kaylen Catlett +Jeziah Mouser +Nahomy Woodley +Alec Zavala +Kyaire Kahle +Cailyn Salcedo +Theophilus Teasley +Jeronimo Council +Adel Welty +Nyla Andrade +Hera Russel +Mirel Kost +Chaz Poston +Yuritzi Carstens +Jayliah Sluder +Abriel Lemos +Stanley Rainey +Nestor Skidmore +Kristal Barthel +Jeb Blackford +Deen Welton +Sabina Loy +Delia Grubb +Eric Lynch +Cassius Funk +Tali Falco +Isac Escalera +Buck Caviness +Reign Purvis +Zamari Packer +Teagen Ivie +Adelaida Adrian +Talib Urbano +Yasmina Abell +Armoni Crooks +Rilee Custer +Kira Whitehead +Octavio Mayberry +Dilynn Rinker +Brooks Gill +Presten Posner +Shanell Persinger +Batya Colangelo +Kalea Lusk +Saina Woodland +Brexton Fortney +Calli Roller +Evan Putman +Cierra Mauldin +Haydon Worthen +Debora Fogarty +Emanuel Beasley +Kenan Halstead +Daleyza Marsh +Ellery Friend +Alexzandria Vanhoose +Alahni Bickham +Koen German +Eleonora Brownfield +Drea Steelman +Jairus Schreiner +Hajar Mcbeth +Sahir Furtado +Grayden Argueta +Adelyn Avila +Marquise Cason +Ty Bolton +Taelor Haught +Briel Mcquade +Demian Nicely +Jasir Aronson +Tyree Boston +Kailer Cottrill +Daniella Wiley +Keanu Prieto +Robyn Crowell +Katalyna Guadarrama +Colin Nunez +Brylan Bischoff +Keagen Niemeyer +Lorelei Richmond +Jayven Noriega +Aylin Kerr +Ayana Zimmer +Jaxon Cook +Creed Roush +Kaliyah Espinosa +Brigid Allman +Blakelyn Enright +Claudio Laing +Roselynn Kwon +Truly Kerrigan +Zariah Vang +Rowdy Troutman +Karter Field +Mayah Loyd +Krew Mattox +Malena Martins +Galilea Crabtree +Kayceon Hoelscher +Annamaria Beaudry +Kiera Avalos +Nate Villareal +Katharine Infante +Elizaveta Donoghue +Calise Congdon +Lucia Clarke +Talin Mcentire +Valen Vermillion +Laikyn Dover +Jentry Siu +Auston Delvecchio +Dakoda Lavin +Maci Randall +Alma Gore +Gibran Bevins +Ashby Coll +Lisandra Holsinger +Lailah Crouch +Arsen Wrobel +Coy Benner +Dyani Stanfill +Bryelle Scalf +Chantal Ruppert +Kallen Nadeau +Rowynn Reader +Paradise Meadors +Emori Bahena +Braelee Coots +Milana Baca +Nelson Shapiro +Luci Weiler +Rayce Joshi +Arsh Gilroy +Brice Rosenthal +Demar Spradley +Sanjay Rosser +Menno Tressler +Kyrie Sawyer +Gabriella Snyder +Colter Beverly +Damarius Suazo +Raymond Pham +Galen Cotto +Saori Malin +Jed Serrato +Fern Rau +Adolfo Montanez +Emeli Esteban +Olan Mong +Aubrielle Sprague +Akshaya Breault +Airam Arneson +Baruch Nowell +Lander Caudillo +Salome Noe +Karlos Copenhaver +Adelina Crowley +Raleigh Schubert +Sylas Dewitt +Jariyah Donato +Brody Gardner +Donavon Saltzman +Ivyana Pendley +Keyla Purcell +Sundus Blakey +Felicity Stein +Madison Nelson +Brendon Chau +Brilee Nation +Mckinlee Hefner +Aurelio Eads +Georgie Granillo +Makiah Cowley +Maelyn Packard +Elijah Martin +Angelia Peltier +Nelly Morey +Burke Cowell +Jacorey Siddiqui +Vanesa Settles +Abram Howe +Kellyn Du +Noa Raley +Jadon Schwab +Neve Forney +Beatrix Anders +Lovina Mansell +Layth Pete +Johann Lyman +Timber Wortman +Antwone Trimmer +Joann Godoy +Fateh Eddington +Avyana Sly +Gabriela Mckenzie +Faye Levin +Scotty Arrowood +Abdulmalik Izquierdo +Rolando Ham +Bladen Cofield +Raizy Kohn +Canon Heinrich +Azaliah Hardaway +Azalia Koss +Reese Clifford +Lucienne Billy +Sara Ball +Melissa Summers +Dalila Bull +Martin Burnett +Zavian Spellman +Elynn Galli +Joe Esquivel +Shylah Banta +Khadija Strauss +Amare Adair +Jasen Kocher +Raider Landin +Elliott Oconnor +Afia Masi +Coltan Vaillancourt +Aedan Mcnulty +Sommer Dann +Parks Juan +Audra Meehan +Roisin Soukup +Maleny Janis +Theseus Colombo +Edgardo Hunsaker +Jewell Cleaver +Tatum Pineda +Kadrian Ismail +Rosy Chowdhury +Royce Dale +Malorie Leake +John King +Lakshmi Fleenor +Edmond Monaghan +Lavinia Prior +Kristiana Mckelvey +Dhilan Walcott +Dartagnan Morano +Mischa Lafrance +Yetzali Moynihan +Sailor Doran +Uma Underhill +Maite Blackman +Tristen Elmore +Getsemani Faith +Bill Bakken +Levi Blaine +Greyson Pirtle +Kaylynn Crow +Arayah Fiore +Wyatt Evans +Micaiah Farrington +Nikayla Ottinger +Lelia Yamada +Zeus Valerio +Demarco Covert +Jarrett Bearden +Cypress Kain +Kamaria Dombrowski +Arrianna Lalonde +Isabell Durbin +Estefany Cecil +Sidra Beltz +Leeam Perna +Nechama Grantham +Yolanda Gagne +Barbie Sheaffer +Kamya Volpe +Armand Herd +Layten Maria +Alexandre Garnett +Ruth Garrison +Emran Kwak +Aking Maney +Mariangel Charron +Sheila Kuntz +Billy Dietz +Mavis Wilkes +Rylin Czarnecki +Charlene Pence +Aadyn Bakke +Adyn Wyant +Dexter Arroyo +Geneva Hayward +Demiyah Spradling +Landri Loveland +Leighton Daugherty +Azalea Whitfield +Naila Holly +Kendall Cabral +Austen Malik +Avyaan Manns +Payzlee Hower +Korah Keil +Laynee Porterfield +Aya Tripp +Logann Wheelock +Lee Featherstone +Tobin Banda +Gryffin Rodman +Andy Gudino +Nakai Crossman +Arlin Mcgaha +Maison Rhoades +Ali Glenn +Suzanne Cromwell +Ailynn Burkhalter +Tyanna Word +Danilo Julian +Rashaad Carreno +Samar Hazelwood +Whitlee Kile +Javontae Otten +Emarie Gaddy +Maryam Bacon +Ailee Hilbert +Wilmer Monroy +Pepper Cooney +Gryffin Rodman +Robin Christie +Oak Hayashi +Jonny Rue +Betsy Bethea +Caston Gravely +Makaio Forester +Shiloh Saenz +Livvy Braley +Praise Hibbert +Alessio Gilligan +Jayanna Lattimore +Syriah Breton +Jazmin Ashley +Claude Conners +Nora Cole +Zabdiel Mullens +Karaline Souder +Keyana Rimmer +Valentina Reid +Solomon Calhoun +Journey Philips +Ameenah Surber +Arianny Dinh +Lillyann Alves +Abdirahman Centeno +Ashlyn Clay +Collin Trujillo +Dutch Chipman +Nayah Jaques +Cai Fitzhugh +Jamal Irvin +Marwan Gandhi +Josalyn Moats +Laine Nall +Yasmine Burleson +Asher Mcdonald +Rockwell Covey +Musab Winder +Nicole Bush +Dulcemaria Frady +Betzaida Nichol +Kimberley Hartung +Adelyn Avila +Braelynn Dudley +Naima Schofield +Atticus Orozco +Keziah Singletary +Aleksandra Duenas +Kaisley Murrell +Shrey Frederickson +Fredy Elliot +Jehu Cabello +Eloise Wilcox +Kasandra Alva +Brinley Walls +Tavion Billups +Regina Bonner +Ryu Freese +Hazen Elston +Zayd Worthington +Alizee Michaelis +Ruslan Davie +Talib Urbano +Rorie Alleman +Eris Woolsey +Eren Varga +Wyland Slaven +Aurea Gandara +Jazmyne Jewett +Mariam Hendrickson +Mikaila Merriweather +Aliza Peralta +Judah Jasinski +Kinley Yates +Laiklyn Geraci +Quincy Vigil +Zamara Laguna +Aster Lammers +Angeli Bonnett +Jeylin Million +Cord Kerwin +Wendell Amin +Christiana Alley +Rian Janssen +Kelsi Batts +Ada Berger +Milania Dodge +Ayaan Curran +Camelia Tower +Bryson Guzman +Reegan Boatman +Bella Ryan +Sephora Warrick +Jalon Newport +Anastasiya Millen +Sandra Arrington +Iziah Jayne +Seanna Enciso +Genevie Govea +Layah Silvers +Noor Mcneill +Rivan Tennison +Amaira Suh +Garett Seagraves +Markeith Mathewson +Sariah Brantley +Salem Bolin +Alanis Reinhardt +Thiago Russo +Raena Berard +Riker Koehn +Demario Doerr +Booker Humes +Ariyan Spinner +Hanah Beckmann +Anaiah Morley +Syncere Eliason +Jaylene Ngo +Leliana Drumm +Damiyah Blodgett +Sapphire Fierro +Leslie Ta +Eleen Alfano +Elouise Behrens +Ilse Harville +Josias Archuleta +Louis Flowers +Greenlee Bucci +Ladarius Claudio +Joseline Mashburn +Charity Stauffer +Brooks Ung +Katana Farkas +Breasia Mcmillin +Alizay Oquendo +Jalen Courtney +Dalia Munson +Clifton Abney +Karly Graf +Ariannah Johnstone +Penelope Fisher +Rhea Leung +Maddilynn Puentes +Marcello Stock +Delanie Herrmann +Aleesa Kellett +Jesenia Schade +Sione Hirst +Jaxin Rhea +Garen Garr +Reef Alt +Paul Espinoza +Shepard Samson +Baylie Kuehn +Kalia Beavers +Marley Patton +Yadiel Nickerson +Chassidy Lukas +Able Fussell +Esai Lozada +Riana Mellott +Avalyn Caudill +Rayshawn Peeler +Dandre Shorter +Cloud Gehrke +Pamela Troyer +Annamarie Mello +Alaynah Brumley +Arwen Mota +Cheyann Serio +Caelum Luedtke +Mason Miller +Khylee Bricker +Malique Lovelady +Madden Nicol +Ariana Alvarez +Amilah Board +Naksh Stringfellow +Quinn Roach +Lee Crockett +Miabella Parent +Stormy Snowden +Surah Oboyle +Thea Stanton +Jasiah Cassidy +Georgiana Alicea +Catalina Ware +Charbel Clift +Andie Shank +Areej Griffen +Leviathan Abramson +Rogue Bohl +Stetson Hackett +Caleah Hudspeth +Johannah Merino +Bayron Kipp +Brenden Read +Miliana Pinckney +Paris Bannister +Danielle Valencia +Carsen Bales +Aleyah Barksdale +Legend Mulkey +Evette Peabody +Dublin Vanlandingham +Darya Kato +Jatziry Reiff +Kinzleigh Lapierre +Sequoia Nutt +Andrae Carlock +Aeris Vickery +Basya Cavin +Journii Jessie +Landyn Madden +Reese Navarro +Gillian Zhu +Evangelina Van +Adhrit Bergquist +Devonte Warden +Bryce Greene +Anh Stelly +Nirvana Sanches +Everley Steffen +Harold Prater +Marilynn Quesada +Tyshaun Hennings +Jozlyn Goodell +Hadassah Portillo +Camille Montoya +Wayland Blades +Ellieana Pye +Brissa Batson +Haylen Midkiff +Austen Malik +Indiana Stidham +Elyana Dell +Leonard Griggs +Ezra Jolly +Dominique Whitlock +Carrigan Chairez +Isamar Witham +Ahaan Rathbun +Lynlee Weems +Kerry Grenier +Rylan Hampton +Laksh Ruch +Fateh Eddington +Julia Ray +Gadiel Sachs +Everett Brazil +Paisleigh Marrero +Mattie Cates +Geovany Faris +Paxson Lesher +Denver Ashby +Cameron Costello +Hermione Wingfield +Hugo Nixon +Paislee Suarez +Aalyah Collis +Anjali Felder +Ansley Nava +Breelynn Warnock +Perseus Bartz +Shmiel Brammer +Massiah Edmond +Sophya Landreth +Lilian Mooney +Lea Jewell +Eder Denson +Acacia Woodworth +Evelyn Parker +Demi Quinones +Denise Cope +Mckynlee Baldridge +Teddy Sauceda +Barbara Samuels +Emeri Ralston +Mishika Toner +Ashleigh Desantis +Aziza Hagerman +Clarissa Smart +Olive Conley +Janis Leftwich +Reynaldo Forrester +Cristian Lamb +Keagen Niemeyer +Gonzalo Askew +Marciano Rana +Alahni Bickham +Gracee Stocks +Anaisha Bevan +Bawi Holzer +Jacinta Burkey +Oaklynn Galan +Zailee Spohn +Deonte Griffis +Jake Cummings +Lyra Uribe +Rodney Engel +Raelee Mackay +Ellamae Proulx +Dorothea Lasher +Said Weed +Shailene Gunning +Harbor Lenard +Jair Sharma +Rivers Gatewood +Leobardo Dufresne +Aj Plante +Aubrianna Hathaway +Lucie Asher +Laiken Grillo +Dontavious Pecoraro +Tavian Roberto +Evalyn Caballero +Mahalia Gregor +Linken Melgoza +Castle Giardina +Ariany Linderman +Rosie Egan +Lucero Noll +Kamdon Avitia +Adleigh Free +Erion Tilson +Kalina Quinlan +Kaiden Salazar +Naia Sander +Onyx Shuster +Hawthorne Brick +Domenick Poss +Harper Kilgore +Wylder Paddock +Ranya Pickle +Ashton Austin +Davonte Boling +Raleigh Schubert +Athena Dawson +Teagen Ivie +Silver Luevano +Alizabeth Sass +Woodrow Hung +Ellis Diehl +Ambrielle Rainer +Jaselle Darlington +Jeremih Kroll +Summer Todd +Kadynce Cargill +Arabella Sherman +Kullen Montana +Jaeden Seeley +Bralynn Dehaven +Bryan Wade +Soha Woolf +Xitlali Nolen +Kahlia Abrahamson +Eugenia Korte +Timmy Cozart +Johana Cable +Kenna Roe +Adya Romer +Lawson Church +Lela Lemons +Ailin Roybal +Kyan Mcarthur +Chanelle Yamamoto +Barry Farnsworth +Sunni Marinelli +Wednesday Dollar +Jalaysia Polite +Maddilyn Harry +Hadeel Hoeft +Avyana Sly +Joely Cardinal +Deonta Thrift +Brynnley Armour +Azura Blackmore +Zanaya Quesenberry +Keiry Nino +Zyler Shen +Amire Tullis +Zahara Cheney +Kelsy Drown +Rima Moncrief +Raylin Orosco +Demond Harness +Davina Willoughby +Malinda Vanwinkle +Irvin Minter +Samaya Flannery +Slate Gallup +Maleyah Cothran +Elizabeth Carter +Quran Cortese +Leonardo Medina +Kaysen Aguilera +Elliotte Newhouse +Skyleigh Coelho +Zakai Leger +Vianna Deangelo +Zack Nobles +Maddyson Oliphant +Corbyn High +Sol Dancy +Rayann Aman +Tristyn Ballinger +Zarek Shanklin +Jayson Raymond +Marshawn Ellington +Viyan Priester +Nisa Laskowski +Adonias Kleinman +Shayan Everson +Rubi Upton +Geronimo Conant +Maverik Rumsey +Avarie Hussain +Kyana Boughton +Kavon Matta +Kaylan Abram +Chanell Coney +Abdullahi Stinnett +Katharine Infante +Conrad Lott +Niah Upshaw +Kellie Kephart +Leander Pichardo +Michel Bierman +Dakota Olsen +Kelia Nauman +Jacklyn Breedlove +Susannah Earnest +Arham Gulley +Kaleesi Mcmurry +Eliah Schutz +Kc Meltzer +Maxx Ferrer +Alliana Drain +Finnian Stockton +Avyan Byerly +Demarco Covert +Conor Cooley +Jaylen Blackwell +Allisyn Ruano +Sanai Casper +Graci Ascencio +Hollis Mcclelland +Anaiya Echevarria +Ellasyn Haviland +Alonna Seal +Ozzie Islam +Santhiago Jim +Lynnlee Buell +Manny Michels +Keana Salmons +Mendel Savoy +Chelsea Dillon +Kasey Currie +Noel Lowery +Keanna Crotty +Addison Witherspoon +Kasyn Eden +Destiny Potter +Lux Thigpen +Eh Rettig +Zamir Farrar +Maryn Martel +Jamire Mauricio +Kamarion Forsyth +Svea Brann +Stellan Wofford +Shayleigh Dimarco +Kaci Ricci +Milagro Yarnell +Aaric Wagers +Zaid Otero +Azul Jameson +Efren Poirier +Bladen Cofield +Ahsan Falconer +Harun Flatt +Ayana Zimmer +Isela Smothers +Kassandra Newsome +Kamren Dupree +Jeffrey Carey +Krish Lind +Cheyanne Lockett +Jared Gilmore +Allyson Conway +Ricki Bessette +Gwen Kimball +Jeyden Burbank +Ashtyn Damon +Carly Glass +Edy Boaz +Azlan Walk +Smith Amato +Sky Stratton +Cyrus Gay +Armando Meza +Jafet Woodbury +Niall Tyrrell +Blakelyn Enright +Kenadi Musgrove +Haniya Gammon +Quinton Gustafson +Jaedyn Eagle +Star Ibrahim +Mika Lander +Logen Shih +Amran Phares +Eduardo Tyler +Erma Strode +Khole Scribner +Nadine Myrick +Berkley Atwood +Anabelle Crews +Iva Tafoya +Aubriella Mansfield +Camari Maley +Newton Alderete +Meira Sellars +Nabiha Duquette +Odette Sandlin +Alisha Street +Galen Cotto +Ivyanna Schiavone +Hollie Clem +Mariajose Sutter +Samirah Hesse +Deklen Lafond +Aditi Thiel +Gerardo Sampson +Maia Goldberg +Dasha Hofmann +Adriana Curry +Gia Barr +Jakari Bigelow +Alaa Gilpin +Marquise Cason +Mihir Willie +Armon Northcutt +Brycen Petty +Ellington Horst +Alfredo Grace +Loki Zeller +Ivaan Garnica +Jayven Noriega +Carnell Braud +Kamora Christman +Monty Korn +Casen Dubois +Heston Plant +Ariona Haskin +Ziyon Watterson +Brooklyn Morales +Abraham Powers +Hania Oxley +Zaryah Stultz +Shekinah Hulett +Diamond Anaya +Akai Hedge +Sylis Weil +Rajveer Trawick +Maleena Carbaugh +Creed Roush +Melody Lyons +Avin Kerley +Elly Zambrano +Khari Johansen +Solange Findlay +Abdulrahman Valdivia +Carolina Benton +Jaycee Mccants +Brock Bray +Kaiah Pisano +Dejah Maddux +Dion Yoon +Queen Hamrick +Leeroy Jardine +Carla Souza +Addison James +Navy Conlin +Abbigale Zito +Tyra Friday +Diana Heath +Zaedyn Witcher +Kinleigh Irving +Yoselyn Rascon +Jazlin Demaria +Lennon Goff +Teegan Griego +Robbie Mackie +Ivey Ashworth +Axl Mcmullen +Micaiah Albano +Leighton Daugherty +Karlie Winn +Archie Easter +Brigette Kautz +Keeley Musser +Airam Arneson +Clive Rivero +Blythe Ceja +Irena Hoard +Maris Hallock +Drew Corey +Kevon Schnell +Marilyn Herring +Juaquin Borrero +Corbin Garner +Lamonte Vaden +Kacee Blas +Howard Reaves +Salih Hocker +Yehoshua To +Carson Foss +Anyssa Carlo +Aminata Forster +Miguel Sandoval +Luther Mcnutt +Aren Dyke +Reginald Shultz +Juliette Gibbs +Regan Quan +Edgar Wyatt +Fernando Stokes +Leelan Kinser +Ayelet Dowdell +Broderick Lytle +Adriel Short +Dequan Pawlowski +Zakaria Zielinski +Rosalyn Jansen +Alisa Keen +River Villanueva +Jacklynn Radcliff +Marygrace Huhn +Nylah Bernard +Jacquelin Toms +Darek Jumper +Dottie Tyndall +Jaylanie Azevedo +Tyrell Lawton +Araceli Allred +Bryer Mclemore +Aviva Gaither +Karsten Bussey +Evren Swink +Indira Markey +Sirena Hom +Fausto Mingo +Kierra Fontaine +Hailee Browne +Axell Culler +Fidel Popp +Jamyla Runkle +Ria Southerland +Eowyn Jessup +Jetta Arambula +Danya Atchley +Karter Watts +Seneca Blakeney +Jaqueline Broughton +Marisol Latham +Aashna Winton +Chandler Luke +Avalynn Toth +Prisha Masterson +Lamar Wyrick +Kenny Champion +Emelyn Haller +Eyad Horning +Maebry Rozier +Kyrell Pankey +Adalberto Kerner +Lake Hagler +Haven Tanner +Alasdair Towers +Tynlee Ruggles +Griffen Poon +Hershel Flournoy +Jewel Hurd +Shannon Mclain +Analiyah Buxton +Jayquan Straw +Morgan Chappell +Lenora Harwood +Sidharth Sokolowski +Ahri Gillett +Ellinor Garry +Kamea Jiles +Asher Southern +Odessa Ramsay +Makenzy Vice +Collyns Saiz +Elvis Whitten +Aniylah Koester +Laya Demers +Korbyn Yancey +Raegan Kirby +Jaila Homer +Aaliyah Castillo +Rashad Marcum +Adelin Mcgough +Demetrius Schmitz +Ashly Brinkman +Jessia Eidson +Serafina Ordonez +Tate Morell +Amina Cline +Tito Frawley +Journie Paxton +Zyra Hadden +Lionel Muniz +Yisrael Jaffe +Jaedon Treat +Christopher Mitchell +Ayala Lower +Khari Omeara +Syrus Hildreth +Eldana Strang +Haydon Worthen +Keanu Prieto +Izzabelle Fetzer +Jenavieve Catlin +Elyza Mabe +Verona Burman +Ellanor Fenwick +Andria Benning +Bodey Danforth +Phoebe Dickerson +Delylah Hennessey +Adilene Lopes +Kenji Lira +Edie Kinder +Maricella Wilken +Aislynn Wendt +Korey Kidwell +Emelia Tyson +Gina Jauregui +Rylin Czarnecki +Edwin Bradford +Jessica Wise +Naftali Fielding +Lizeth New +Deonna Mulholland +Kynzie Dore +Embree Chisolm +Semaj Paschal +Race Marini +Jerzie Lippincott +Noa Tolbert +Raul Costa +Janette Koonce +Chiamaka Songer +Kaydence Lefevre +Ellena Bruton +Dayana Hatcher +Tommie Sansone +Jenesis Arnett +Xion Wardell +Aeden Littrell +Juanita Cady +Michelangelo Resendiz +Millie Levine +Maysen Oman +Matthew Lopez +Yaakov Longoria +Ruhi Tremblay +Cailee Osman +Analee Pond +Tidus Brasher +Tyler Driver +Torrance Dinardo +Arina Ritz +Maram Willette +Jaxston Montenegro +Cheryl Schaub +Brantly Fried +Maddelyn Gallego +Dustyn Manor +Basma Calle +Subhan Harner +Zyla Calkins +Elia Mahan +Tegan Mcqueen +Clinton Wilburn +Armin Hamer +Braxtin Lampert +Bruno Painter +Allana Ehrlich +Damoni Camper +Madilynne Tunstall +Analyn Shear +Edith Fulton +Mylan Riffle +Olan Mong +Rihaan Liston +Antwon Shane +Ronnie Wilhelm +Della Coy +Orrin Bertram +Porter Baran +Jessie Ahmed +Champion Honea +Vania Bill +Theia Sledge +Aharon Lor +Monika Fick +Corrine Pilgrim +Nuha Hartline +Azriel Mathew +Joah Dawes +Nicolle Mclellan +Stacy Tweedy +Menno Tressler +Thaddeus Hammer +Elleanna Donohoe +Damoni Tyree +Cortez Fernandes +Getsemani Faith +German Ebert +Gaston Smithers +Bennett Gable +Talya Mahon +Natan Hendershot +Frances Kidd +Lilyan Gough +Cayleigh Deguzman +Ismail Messina +Viggo Thrash +Lazaro Welker +Marlow Settle +Skilar Camden +River Deleon +Joziah North +Benedict Tubbs +Dallas Robles +Marlei Marker +Summit Toland +Ruthie Cowart +Ella Cooper +Kimberlynn Daughtry +Gray Wylie +Reilly Marquardt +Lanae Detwiler +Jacquelynn Murguia +Peyton Patel +Truett Pak +Royalty Woodall +Nella Hartnett +Lincoln Araujo +Shanice Colunga +Viviana Clements +Rania Mcwhorter +Xoe Binion +Kirill Garretson +Giorgio Minnick +Emmalina Alter +Kamdyn Platt +Bristol Estes +Rochelle Pitre +Destinee Hummel +Grecia Tierney +Dax Ritchie +Michaela Zhang +Decker Maier +Roslyn Mcdonnell +Adelaida Adrian +Ved Wegner +Landon Derose +Darian Fedor +Sara Ball +Cameryn Popovich +Roan Saxton +Hartlee Fontanez +Bailee Dillard +Leelah Gilmartin +Zania Willison +Cristina Whitt +Trey Wills +Jalayah Cintron +Rayden Velasco +Braylon Huynh +Kenson Loo +Kam Hibbs +Lochlyn Athey +Mekhi Fish +Emalee Groff +Javari Faria +Awa Halford +Mattilyn Dills +Giovani Hannah +Parker Moody +Chaim Gallo +Keiran Standridge +Blaise Lukens +Javien Ingersoll +Rowen Hong +Kaysen Erdmann +Khalani Goodall +Azucena Gregoire +Anisha Alcaraz +Kadyn Landau +Adlee Derr +Jareth Sandy +Kendall Cabral +Maddison Berg +Tyree Boston +Saryah Auger +Meera Bowser +Angel Jenkins +Amery Monteleone +Heidy Mchenry +Kensley Mcnamara +Grant Frazier +Allee Strasser +Ziggy Gong +Rosalinda Fleck +Campbell Foote +Klaire Pitman +Baylei Cicero +Jizelle Bryce +Miliani Chancellor +Ashlynne Staub +Stanley Rainey +Hatcher Yancy +Arlen Duhon +Landon Morgan +Lariah Bunnell +Eamonn Pawlak +Everlee Pappas +Malak Dawkins +Eian Pieper +Ehan Celestine +Kayson Sanford +Hillel Sistrunk +Halina Sowards +Lance Sheehan +Paityn Do +Deklyn Mckeon +Theophilus Teasley +Koy Heald +Eliyana Borrelli +Minna Barto +Markell Bianco +Keylin Deason +Janylah Kempf +Ivanka Searle +Shaylyn Glasser +Gunner Townsend +Xavi Brice +Avaya Begley +Maizie Cha +Dinah Strait +Jenny Rock +Jhene Almonte +Zyair Harless +Palmer Coles +Kaliana Knighton +Rudy Bauman +Gwendalyn Forsberg +Xochitl Florez +Jayleigh Guyton +Ainhoa Arruda +Nawal Judkins +Jordi Danielson +Declyn Bumpus +Meredith Belcher +Rueben Putney +Amira Ellison +Aayla Sotomayor +Jett Marks +Linus Marroquin +Avary Brittain +Bronson Bowles +Maylani Whyte +Jodie Neale +Bobbi Lavigne +Case Bruno +Adreanna Colyer + +Cristiano Spicer +Fausto Mingo +Brentlee Worthy +Neftali Mercurio +Zayyan Tincher +Eliyanah Corry +Amayah Kimble +Diamond Mccollough +Fredrick Overstreet +Devyn Sam +Alitza Frink +Nariah Pringle +Avneet Mannino +Eamonn Pawlak +Venus Voigt +Kamaria Dombrowski +Akayla Hohman +Kei Gideon +Eloisa Lamm +Jehu Cabello +Winslow Santini +Cormac Rooney +Makaylee Funderburk +Yolanda Gagne +Ysabel Longley +Erin Macdonald +Eliora Botello +Aura Kaye +Hogan Santangelo +Cameren Weigand +Sakura Corwin +Blanca Lindberg +Dariela Haider +Zyair Harless +Ori Pabon +Henley Wilder +Dillon Proctor +Zendaya Babcock +Reya Penny +Fareed Krol +Sury Lock +Carina Solano +Tania Houck +Mykel Ledezma +Keith Sosa +Kalista Rath +Lexani Asuncion +Juliett Stadler +Marcia Ahearn +Jerzey Nemec +Kendell Demaio +Kaidyn Hartzell +Isreal Tribble +Lillyana Sotelo +Aadhav Hermanson +Liya Swope +Kyran Counts +Abdulmalik Izquierdo +Ellinor Garry +Perrin Tallent +Dmari Bojorquez +Parisa Vineyard +Nayla Blank +Paradise Meadors +Eivin Cooksey +Mirabel Stith +Taten Hartshorn +Ellery Friend +Branden Parnell +Jusiah Cranston +Jeter Molloy +Anaisha Bevan +Joi Cave +Makeda Robillard +Jakhari Simmonds +Bryton Grasso +An Milan +Sequoia Nutt +Teagen Ivie +Kacen Ricker +Emory Downey +Raleigh Szabo +Deasia Padron +Javier Fischer +Deonta Thrift +Zailey Lenhart +Younis Knisley +Kinlee Barrow +Zion Eubanks +Silas Harper +Jasmin Jorgensen +Ellia Matheny +Caiden Underwood +Paxton Wolf +Patrick Stanley +Jayani Lucia +Leighann Mejias +Tyus Mchale +Yitzchok Farias +Jaziah Buie +Kenslee Flick +Miles Kelley +Gloria Newell +Quin Rubalcava +Khali Sines +Nomar Works +Priyanka Hansel +Rheagan Hartfield +Andrea May +Aylani Gormley +Swara Wooldridge +Nashley Bergin +Warren Case +Landin Boettcher +Jayleen Vaughan +Advika Nave +Cristopher Reagan +Snow Gault +Abdias Beller +Kaizer Lawhorn +Jadyn Hornsby +Jazleen Wallin +Allegra Leclair +Polina Sato +Maxx Ferrer +Rima Moncrief +Ethan Martinez +Cynthia Law +Kiarra Autrey +Carolynn Mincey +Kendell Thibault +Dustin Daly +Ciro Stryker +Rosemarie Streeter +Ada Berger +Arissa Palomino +Kenlie Halpern +Kullen Montana +Majesty Sigler +Karsynn Harbour +Nickolai Dossantos +Awa Halford +Larson Barta +Tyrion Somerville +Esma Eddings +Camden Fernandez +Tydus Beggs +Carmelo Dunham +Blakely Winters +Anora Blanks +Madelyn Shaw +Kerrigan Coble +Jaylon Spear +Jelani Shumaker +Hadley Jensen +Marquis Goldsmith +Aubreyanna Wager +Amilia Hannon +Graysen Laird +Geovanni Mccallum +Nazareth Gast +Mylee Sammons +Wesley Alvey +Aiyden Santillan +Jewel Hurd +Dylan Arias +Tristan Ferguson +Madhav Severino +Marlayna Ericksen +Kylin Deanda +Irene Dickinson +Isha Sebastian +Marianna Hadley +Mckenzi Alberts +Jayana Orcutt +Elder Fraga +Arianah Mapp +Fenton Spano +Rubi Upton +Meredith Belcher +Klay Mallett +Bellarose Schatz +Thomas Cox +Legend Cantu +Keily Cottrell +Arleen Millar +Zakariah Trull +Aysha Mcauliffe +Trisha Stull +Aydrian Belisle +Lola Mccormick +Quinn Roach +Bodie Barney +Eoin Villalpando +Suhayla Mask +Maryama Swaney +Moussa Ito +Latham Jakubowski +Genessis Dominick +Ambrose Held +Aaralyn Tiller +Jalayah Cintron +Zeppelin Laplante +Rita Mulligan +Berklee Sayers +Jalen Courtney +Alton Crawley +Anyiah Tapley +Mustafa Dumas +Max Armstrong +Aranza Carmichael +Kayley Muse +Josiah Cruz +Geovani Kerby +Lucian Stover +Koltyn Eisenberg +Griffen Poon +Bryanna Godwin +Violett Godsey +Lamonte Vaden +Khadijah Wadsworth +Elliana Hancock +Blakley Crowl +Analie Grable +Ameenah Surber +Guy Caron +Logan Mcintosh +Xayden Bane +Waylon Francis +Aveline Bader +Darlene Joy +Brennen Scanlon +Dominik Quick +Ellaina Holub +Dariana Lipscomb +Camia Revell +Briggs Coronado +Avyaan Manns +Josephine Estrada +Kelsea Pilcher +Jena Chaffee +Uri Melendrez +Jacee Lent +Padraig Senior +Zaiden Hendricks +Weslyn Helfrich +Mayer Rohr +Markell Bianco +Candace Luciano +Erabella Mcclean +Dylon Armbruster +Agastya Ballew +Annalyse Wojcik +Mavis Wilkes +Tanner Wilkie +Fatimah Alfonso +Elyza Mabe +Jewelz Wille +Oskar Catalano +Laniya Sikes +Esai Lozada +Jaleigh Sale +Sebastian Turner +Elvira Nickell +Presley Brady +Bradlee Dykstra +Jolee Maas +Teague Delafuente +Earl Kong +Alicen Hewlett +Julieta Wesley +Legaci Roane +Alastair Brehm +Naftuli Seguin +Soraya Torrez +Ailany Thomasson +Angely Sowell +Adelyne Klotz +Bay Engstrom +Darell Sanger +Simran Spires +Foster Dow +Ananya Parrott +Rishi Wharton +Camora Huckabee +Austynn Turgeon +Melissa Summers +Mattison Vaccaro +Evin Lovato +Violetta Caswell +Uriah Foreman +Eniyah Mazzola +Dannie Cancel +Ammar Littlejohn +Callen Finch +Aveah Nigro +Cooper Peyton +Corben Emerick +Truitt Feinberg +Royalty Forehand +Amen Chestnut +Sherman Woodring +Reaghan Alam +Jaida Roper +Allen Vance +Lincoln Barnes +Billie Pickard +Darwin Calvert +Halen Boutin +Ariany Linderman +Dariyah Nieman +Nechama Grantham +Walid Knepper +Cambrie Finnegan +Jan Chao +Karolina Hershberger +Kohen Hinson +Micaela Giordano +Indiana Stidham +Minnie Shade +Harper Scott +Aminata Forster +Sarina Hwang +Anastacia Ambriz +Brylen Lueck +Booker Humes +Sandra Arrington +Janie Brinkley +Bryer Mclemore +Blythe Ceja +Finnick Cartagena +Maddelyn Gallego +Zev Barrientos +Dorian Truong +Jessi Durden +Amelia Campbell +Danae Hermann +Dmarion Tasker +Jadelynn Husted +Aiyanna Priest +Kit Beaumont +Bawi Holzer +Nancy Michel +Adalyne Goodin +Kyngston Tingle +Stirling Cardillo +Nami Dey +Zebadiah Birdsall +Zeina Nussbaum +Jacori Hiner +Delilah Davidson +Tevin Bair +Vyom Faught +Jailene Liddell +Jaleigha Silcox +River Villanueva +Braylyn Liggins +Noe Padgett +Kaysen Aguilera +Ozias Pizarro +Alenna Gonsalez +Carolyne Rummel +Reniyah Bengtson +Marlei Marker +Charlette Turnage +Exavier Lebeau +Blayne Mccallister +Talan Eck +Carlisle Bridgeman +Lamar Wyrick +Ronav Lofgren +Thoren Parente +Marcella Corral +Theadora Chasteen +Zerenity Buckler +Phoebe Dickerson +Zaya Lanning +Enoc Rigdon +Brookelyn Schoonover +Miya Nowak +Syncere Dorn +Jabriel Burciaga +Rainy Brazell +Malaysia Krueger +Layla Sanders +Marko Hardman +Findley Waterhouse +Aryanna Tovar +Shaurya Parkinson +Kage Hard +Yumi Gerken +Winter Soileau +Talaya Stutz +Jacion Monday +Zoriah Grams +Huckleberry Biggerstaff +Asad Yin +Navy Conlin +Arya Schulze +Zury Macdougall +Collyn Sitton +Kamori Nevels +Maylee Vandyke +Elie Renshaw +Johnnie Hoy +Eleen Alfano +Fradel Frakes +Eleyna Burgett +Tory Shropshire +Romero Holz +Natalina Starke +Sianna Mccrory +Mayeli Geis +Malea Scofield +Vishnu Myatt +Jakeem Tryon +Hellen Domingo +Amna Palm +Shrey Frederickson +Jacob Garcia +Shreya Edmondson +Raylie Mcalpin +Pilar Sung +Eshal Maitland +Haddie Jacques +Citlali Cousins +Eason Seay +Axyl Broadnax +Brayan Xiong +Jones Guenther +Whitlee Kile +Ena Wortham +Muhammed Scully +Capri Saavedra +Kirra Franke +Ainsleigh Wan +Payson Hargrave +Maisey Lavelle +Dalylah Dulin +Ely Donahoe +Khylen Rowles +Maryan Bingaman +Cesar Roth +Eastyn Almaraz +Dejon Lenoir +Clara Jacobs +Neila Doctor +Brielle Bates +Christian Rivera +Montez Warwick +Shelton Lehr +Casimir Eklund +Becca Moye +Cassie Michaud +Khamari Timmerman +Alaiah Mullinax +Stacy Beckman +Valentine Benford +Lucinda Bertrand +Saydee Lightfoot +Shivani Bonnell +Tierra Pelayo +Manha Shumate +Elida Omar +Kian Merrill +Cailey Peeples +Zuleyka Benavidez +Zaeem Larrabee +Carmella Epperson +Carys Soliz +Kenton Vidal +Nirvi Starrett +Mila Henry +Sherlyn Navarrete +Finley Mack +Bridgette Luu +Jamila Rawlings +Deklen Lafond +Bryleigh Raines +Indra Deegan +Harriet Baughman +Deklin Bobbitt +Kaysen Erdmann +Trayvon Hutcherson +Andria Benning +Brantly Fried +Tiana Head +Lucienne Billy +Beatriz Majors +Amanuel Bozarth +Zipporah Hazen +Brendyn Saito +Kenzley Solorzano +Elmer Trammell +Uzair Giannini +Nakayla Borland +Jese Wehner +Reyes Bosley +Katiana Mosely +Shahd Schoenfeld +Selena Hobbs +Sadia Cordoba +Andee Vanegas +Barbie Sheaffer +Legacy Chong +Natalya Duff +Kamil Silvia +Musa Shook +Keyan Brookshire +Martez Ledoux +Theia Sledge +Brekken Tinney +Stacey Derrick +Isa Upchurch +Mariajose Sutter +Saira Sparrow +Edan Kowalczyk +Yahaira Talavera +Taleen Runge +Scotland Merry +Finnian Stockton +Erick Drake +Briseyda Bristow +Lashawn Mccourt +Infinity Mcgaughey +Naylah Mulvey +Kaisyn Dehoyos +Dana Aragon +Blake Gould +Dustyn Manor +Katherin Burgin +Josie Colon +Raymond Pham +Joziah North +Samar Hazelwood +Akemi Brodsky +Eiden Roney +Raider Landin +Scotlynn Backer +Star Ibrahim +Effie Bedell +Dennis Albert +Shakira Boardman +Bryan Wade +Reginae Wulf +Makenlee Just +Farida Gourley +Londyn Baldwin +Jazel Hummer +Benyamin Mcabee +Conlan Roseman +Jackeline Rupp +Roy Tillman +Daila Soles +Mercedes Comer +Karla Bright +Viana Towner +Stormy Snowden +Brihanna Wester +Alexah Lark +Irving Fahey +Haziel Frazee +Kallee Reep +Jackelyn Carrigan +Tremaine Mullis +Rosanna Gaskin +Valkyrie Voelker +Arian Wroblewski +Georgina Wyman +Adalin Templin +Channing Paulson +Lottie Mcvay +Bruchy Garzon +Aminah Boucher +Menachem Arteaga +Maybree Ginsburg +Kingston Montgomery +Emelyn Haller +Avree Mcglone +Ruby Bradley +Amaziah Eastwood +Donatello Winkle +Jeremih Kroll +September Kratzer +Bode Humphries +Favian Beecher +Alexandra Gilbert +Diana Heath +Omari Britt +Bishop Mock +Adelynn Mathis +Dinah Strait +Maddilyn Harry +Miko Arrieta +Embry Remington +Alyzah Maughan +Devonte Warden +Jo Fenske +Carol Freitas +Jorja Stott +Darrius Easterling +Demari Kiefer +Manar Banister +Celena Espiritu +Analiyah Buxton +Grady Woodard +Jaydyn Hageman +Collins Kellum +Luana Dulaney +Ishani Dee +Kareena Salley +Hazel Dixon +Brooklynn Blair +Alonso Greenberg +Levon Agnew +Chyanne Gaylord +Baila Keane +Layton Christopher +Prisha Masterson +Carla Souza +Annsley Glaze +Linnea Vanhorn +Adem Tse +Bryelle Scalf +Whitaker Ealy +Liliann Clemmer +Slade Scales +Braxton Silva +Kynslee Reich +Ward Garren +Neko Ayon +Timber Bradbury +Crystal Wooten +Soren Hastings +Kaela Groh +Axton Hand +Everardo Whittle +Kason Conrad +Scarlette Heard +Kenson Loo +Owen Torres +Adina Oates +Caesar Mateo +Elizah Jeffcoat +Kaeleigh Routh +Saja Wilfong +Samara Sinclair +Dior Darden +Jaicee Fuhrman +Mckinleigh Despain +Saori Malin +Korah Keil +Amorie Moretti +Leah Hamilton +Tayson Backus +Kooper Hairston +Cruz Grimes +Louie Nagy +Jordy Mccord +Eira Borchardt +Payslee Breland +Caelyn Mccutcheon +Jerry Guthrie +Reynaldo Forrester +Kamran Cordes +Elenore Dyess +Alainah Spratt +Kofi Canas +Corah Kurz +Sage Bartlett +Tahir Delp +Sahar Manriquez +Wilmer Monroy +Amare Adair +Graeme Turpin +King Guerrero +Khalani Goodall +Vihaan Ervin +Katalyna Guadarrama +Camdon Probst +Carrick Hetherington +Keniyah Davy +Merrick Mena +Margaret Mccarthy +Jaynee Stamp +Ophelia Sands +Myiah Valley +Yelitza Pettus +Mackson Pitchford +Zavien Garfield +Kade Reilly +Evey Stackhouse +Ashtyn Damon +Taya Bateman +Gema Lerner +Carrigan Chairez +Darla Osullivan +Dionte Bitner +Beverly Forman +Elias Rice +Advay Collard +Sakina Moller +Jasean Lowrance +Anabela Morfin +Lian Nesbit +Domenick Poss +Jahsiah Gwin +Branton Lerch +Courtlynn Abbas +Eidan Beamon +Jasper Moss +Leen Brill +Lakai Chauvin +Jaxsin Millet +Zian Recinos +Marlee Rasmussen +Haris Shreve +Daijah Merryman +Darrick Ressler +Wolfgang Albertson +Aliya Smiley +Deniz Mcdavid +Janylah Kempf +Kaylana Arney +Liliane Kugler +Zahira Firestone +Graceson Weidman +Rain Peter +Nila Hanlon +Alston Tedesco +Aydon Hui +Benson Esparza +Jayliah Sluder +Broxton Foshee +Leylah Luck +Treysen Kujawa +Kezia Fielder +Kelsie Gage +Juliette Gibbs +Charlene Pence +Yasir Eng +Brilee Nation +Edrick Slaton +Janiah Beaulieu +Antony Wheat +Ezekial Danley +Houston Darnell +Arianne Mccue +Jazaria Mccusker +Viggo Thrash +Pandora Bode +Chrisette Wittman +Phoenix Coffey +Saige Zapata +Brileigh Sturdivant +Karly Graf +Drea Steelman +Thatcher Shaver +Layten Maria +Fidel Popp +Janessa Buckner +Jovanni Banuelos +Caitlyn Magana +Ryett Christner +Aubree Spencer +Musab Winder +Atlas Slater +Alexandros Wayman +Charlee York +Lillyan Denham +Abdallah Batiste +Dayton Milton +Woodrow Hung +Ramon Stern +Aashi Heintz +Susie Wheaton +Livie Glidden +Tanush Lasalle +Paola Feldman +Maddalyn Theisen +Arjan Freer +Marwan Gandhi +Wylder Paddock +Envy Schock +Hailee Browne +Loryn Fiske +Aizen Sherrod +Kylei Castanon +Warner Buchholz +Kadyn Landau +Mianna Shock +Lenny Mccartney +Mesa Trussell +Jordany Wingert +Lizzy Lafountain +Claude Conners +Samaya Flannery +Maddux Kaminski +Paxon Colter +Tyleah Mcneese +Giuliano Messinger +Yuvaan Traynor +Joan Rafferty +Mileena Garay +Emi Augustine +Javien Ingersoll +Gabriel Futrell +Devante Loving +Carma Frisbie +Caliana Strickler +Amelya Rothstein +Keyonna Herren +Braylin Martines +Jeriah Roundtree +Clio Campa +Rudolph Loudermilk +Kameren Files +Paloma Barnard +Deonte Griffis +Berlynn Quinton +Alondra Mosley +Angela Bowers +Gisselle Knott +Maejor Pauly +Franklin Cordova +Ford Doss +Luciana Dickson +Liesel Munro +Daysha Conard +Randal Wachter +Camren Kerns +Vita Mcelhaney +Riggins Allgood +Alder Albin +Kendal Kitchen +Fatema Perrotta +Maliah Connors +Freddie Caceres +Uriah Goodnight +Suri Carlos +Zena Edens +Ronnie Zack +Maritza Coats +Ashleigh Desantis +Rylen Squires +Laikynn Edelstein +Youssef Ogle +Harleen Davey +Hindy Brinker +Carli Chisholm +Zada Hague +Mary Pearson +Yariel Haskell +Elisabet Scholten +Emile Vansickle +Josias Archuleta +Miranda Sweeney +Deanthony Judy +Kora Rodriquez +Shayne Bunting +Elaine Mayes +Navaeh Watanabe +Krew Mattox +Jaiden Tom +Nasya Loring +Lacey Werner +Demya Crumpler +Randall Toledo +Dayani Palomo +Abygail Alba +Eleanore Winstead +Kyli Salyers +Jeylin Million +Jaleel Bernier +Yasmin Sheffield +Cloe Harkness +Esha Strader +Aariyah Marley +Beauregard Trexler +Safwan Treece +Khai Henriquez +Daphney Charleston +Jesiah Whitmire +Lexus Button +Alaric Chatman +Tamera Senn +Azrael Sarver +Ayman Ocasio +Levi Murphy +Alyssia Spell +Erianna Bee +Gracelyn Mckee +Zaelynn Shabazz +Karsen Wold +Nihira Spiller +Oona Gooch +Karl Pfeiffer +Grant Frazier +Brandon Owens +Azalea Whitfield +Chavy Duffield +Rowan Eaton +Evalina Fredericks +Elanor Rife +Lian Keener +Shaylyn Glasser +Jaivion Carnevale +Annika Talley +Waylan Hammel +Dimitri Prescott +Salvador Coffman +Omere Koo +Millicent Dupre +Dea Enlow +Zacharia Neiman +Caylee Stiles +Makhi Kumar +Caden Park +Maleena Carbaugh +Alijah Bracken +Avelyn Vargo +Rafael Decker +Nicolo Stroman +Jayvian Dilley +Kingdavid Mirza +Jaelynn Ng +Osvaldo Goodson +Damiyah Blodgett +Avery Neal +Bennett Day +Chole Buckman +Binyomin Ridgway +Kyndall Trotter +Shivam Grose +Aidan Vazquez +Brie Pounds +Hillary Shanks +Zaydin Pattison +Colbie Chance +Errol Haugh +Maahi Ronquillo +Elisha Gil +Jacy Burress +Arlene Epstein +Tyshaun Hennings +Johnpaul Brinson +Kingsley Jarrett +Madalynn Childress +Sabir Leininger +Nour Stephen +Misha Jacobo +Ishmael Hopson +Zyaire Stclair +Shae Ayres +Curtis Tracy +Olan Mong +Trevon Carreon +Bridger Nunn +Sephora Warrick +Rhythm Fleischer +Dolores Vanness +Marielle Westmoreland +Elnathan Ogletree +Ameen Nester +Raylee Bergman +Lucie Asher +Matai Esteves +Keren Agee +Raylen Linden +Perry Kelso +Quinton Gustafson +Aralynn Guarino +Bastian Mccrary +Abdelrahman Rives +Raniya Otte +Darnell Longo +Edvin You +Kynnedi Drayton +Cameryn Mariscal +Everly Vega +Quinn Munoz +Leif Stoddard +Emilia Benson +Qasim Granado +Arlo Slay +Talitha Carper +Kori Saville +Guadalupe Chamberlain +Dawud Ahumada +Macklin Quinonez +Akshay Whiteley +Craig Knutson +Melannie Vollmer +Cleo Phelan +Bowen Helms +Annmarie Luce +Kennedy Porter +Jacari Ferrari +Lailah Crouch +Harlem Moreau +Brailynn Beeman +Raigan Obregon +Chavy Duffield +Dave Amundson +Khang Heinen +Meilani Fitch +Ishan Skipper +Lahna Bobadilla +Lotus Sifuentes +Makenlee Just +Inna Mentzer +Darci Grajeda +Juliano Devera +Chastity Rentz +Mathilde Decosta +Skyler Knox +Tim Denison +Aryanna Tovar +Judah Jasinski +Cindy Greco +Kian Merrill +Hartley Braxton +Zymere Bainbridge +Elija Peppers +Boe Gendron +Salena List +Elan Charlton +Octavio Mayberry +Korie Curtin +Madisen Crittenden +Denver Ashby +Christan Paugh +Keisi Duron +Braylin Martines +Jaila Homer +Keelie Spindler +Leighann Mejias +Hanan Greenwald +Esther Saunders +Nizhoni Grafton +Jaylyn Mandell +Mahlon Brooke +Maayan Calderone +Marley Soriano +Emmery Paterson +Dejah Maddux +Keely Beall +Marisela Bontrager +Mark Mckinney +Natalina Starke +Reginae Wulf +Harlan Wideman +Buck Caviness +Nevan Lail +Rebekah Carver +Amaryllis Binkley +Brystal Orton +Karleigh Staples +Judah Miranda +Journee Sexton +Caelan Truax +Rowen Gresham +Renner Kornegay +Kaili Borja +Naveen Fast +Jamar Loomis +Jerzee Pastrana +Niah Upshaw +Oliviana Ranson +Timofey Dutra +Zaidyn Lumpkin +Clifford Ricketts +Marely Baumgardner +Carina Solano +Rusty Squire +Kamber Almendarez +Arik Nelsen +Oakleigh Higgs +Jaziah Mckeever +Maylie Grindstaff +Shane Whitaker +Makynlee Vicente +Henson Cowden +Eve Rowland +Danah Fragoso +Katana Farkas +Dillan Sager +Canaan Trent +Corra Kass +Kwame Penland +Aishah Ku +Shamya Saba +Mykah Ochs +Gwenyth Matlock +Kyara Newland +Naeem Mapes +Caprice Countryman +Marshawn Ellington +Annasophia Bove +Aubreanna Leboeuf +Harlym Didonato +Kaito Skeen +Adelina Crowley +Davien Digiacomo +Mateus Schutt +Zamarion Busse +Jazlyn Haney +Rylan Urban +Janay Vanburen +Emberleigh Barroso +Porter Baran +Suhaib Zurita +Adalyne Goodin +Jayce Burke +Kamia Svoboda +Aerial Halter +Alesha Laboy +Fabio Reavis +Clarisa Cogan +Gibson Mark +Collier Eberle +Carrick Hetherington +Glory Peak +Arden Bermudez +Angelynn Geiser +Audrey Graham +Karizma Brokaw +Michele Hulse +Jahziel Jacquez +Horacio Dorado +Izabell Colton +Remmy Boyette +Landon Morgan +Morrigan Philpot +Skarlet Schuetz +Miller Kling +Lacy Trout +Gregorio Dong +Kelly Maki +Reid Hess +Lian Keener +Poppy Cagle +Bea Olney +Gavyn Dowd +Sahil Stroup +Ysabella Trombley +Joella Reinke +Ashly Brinkman +Jalaysia Polite +Zyler Shen +Moksh Gulledge +Chantelle Smedley +Kaira Conover +Jessy Fillmore +Keziah Singletary +Jaydan Pemberton +Akai Hedge +Mirna Braddy +Skyla Quintero +Seraphine Bittle +Damon Haley +Odalys Salmeron +Kylea Dowden +Zaedyn Witcher +Eoghan Copp +Zia Devore +Demarius Endres +Mariangel Charron +Anne Holley +Indiana Langlois +Azaleah Farah +Zayvion Mayhew +Mckinnley Kilby +Samarah Flack +Jessy Philpott +Yulissa Plunkett +Emy Mak +Hudsyn Ludlow +Levi Blaine +Calina Sisneros +Callahan Gillen +Lucille Phelps +Afton Mcclintock +Lakelynn Avant +Sommer Dann +Linnea Vanhorn +Lennox Lancaster +Lilith Oneil +Luc Son +Dakota Mccullough +Dalton Kane +Zori Ledet +Georgiana Alicea +Ansel Main +Lennon Stinson +Khaleel Dilorenzo +Atziri Vereen +Myra Kern +Jeancarlo Mcanally +Jahsir Dressler +Zayna Rausch +Kaidyn Hartzell +Auston Delvecchio +Karen Kaiser +Urban Gatto +Zamiyah Yarborough +Sherlyn Navarrete +Casandra Hering +Carsyn Willey +Baleigh Mallon +Blakelee Rodarte +Meika Cropper +Lyndi Giffin +Priya Zaragoza +Allisyn Ruano +Graci Ascencio +Craig Knutson +Hawa Hofer +Drew Corey +Laron Hsieh +Taran Naughton +Gracelynne Fiorentino +Lillianne Mcclinton +Kingsley Jarrett +Amanuel Bozarth +Warren Case +Semaj Paschal +Caris Seale +Wayde Sandhu +Michal Menke +Knox Owen +Kylin Deanda +Yetzali Moynihan +Catalia Vong +Ahad Guth +Kamea Jiles +Pepper Cooney +Ahtziri Nilsen +Larkin Cottle +Dakota Olsen +Trever Kuehl +Aaden Angel +Bryston Mustafa +Rustin Galicia +Lexani Asuncion +Mikel Wheatley +Elizabeth Carter +Mika Beebe +Salman Donald +Kloee Jurgens +Nariah Pringle +Donato Gilliard +Kain Sell +Lenna Peavy +Eisley Vann +Semaj Coley +Nikole Chiles +Dariel Dill +Avery Collins +Chantal Ruppert +Eliyah Bethel +Aspyn Neville +Giancarlo Queen +Eden Katz +Chase Nowlin +Makenzy Vice +Alessandra Abbott +Cady Renz +Zury Macdougall +Tyson Christian +Cloud Gehrke +Rosie Egan +Yahir Metcalf +Zya Fore +Paloma Barnard +Arriana Gambrell +Nika Woodcock +Sage Stroud +Dominique Whitlock +Novalee Wetzel +Madysen Gilstrap +Kelly Good +Adalyn Barnett +Randi Deboer +Manolo Apple +Lainey Blanco +Verona Burman +Kacper Hersh +Elyjah Lemieux +Paris Jay +Kobi Torrey +Robby Gorden +Skyleigh Coelho +Maxx Ferrer +Audriana Eason +Salah Cornelison +Otoniel Engels +Alaya Kurtz +Yonatan Strunk +Cataleya Friedman +Luqman Palomares +Melony Cassady +Shourya Magill +Lundyn Desrosiers +Jarrell Aubrey +Windsor Spry +Madaline Addington +Niya Reiter +Jair Sharma +Amarri Callison +Daya Harbaugh +Orianna Monteiro +Stryder Neary +Kamora Christman +Kamdyn Allard +Mahogany Rupert +Arsema Chitwood +Avelina Abrego +Avani Falcon +Aydrian Belisle +Amaiyah Fontes +Kashton Deluca +Lillee Slayton +Sarina Hwang +Ashur Mckean +Jaslynn Mancuso +Alyzah Maughan +Dawn Hanes +Naksh Stringfellow +Makynzie Babin +Mona Garibay +Aryam Fortuna +Mirella Sirois +Kroy Mayers +Karson Dorris +Elisa Terrell +Alexie Pompa +Fabrizio Reams +Janiece Channell +Karlee Tomlinson +Talitha Carper +Zaidan Gruver +Ruston Sealey +Ilias Elswick +Randy Lim +Daxx Leitch +Philomena Loper +Maaz Struck +Mendy Jacobi +Sena Kissinger +Macklin Quinonez +Layne Peterman +Dayanara Steel +Maniyah Warr +Galilea Crabtree +Irvin Minter +Ilona Cureton +Miriam Villarreal +Melinda Dowdy +Yareli Root +Kabir Devries +Genesis Stone +Jazlene Bostwick +Faigy Soares +Kennadee Peraza +Angelique Welsh +Marciano Rana +Lynnlee Buell +Alahna Roos +Renesmae Suttles +Iveth Monteith +Akiva Huntington +Fox Lo +Caydon Tollefson +Aira Telford +Jaxston Montenegro +Kaesyn Fessler +Agustin Malloy +Naiomi Laroche +Daelyn Truesdale +Anna Marshall +Sullivan Rambo +Thorin Acuna +Callie Blake +Love Moffitt +Zaeden Ozuna +Alexiana Threatt +Saw Earp +Levy Barner +Mariano Hein +Legend Mulkey +Armon Northcutt +Saad Deyoung +Kalia Beavers +Dusty Thompkins +Christianna Clanton +Dempsey Stivers +Eliza Rojas +Kasyn Eden +Ezekial Danley +Dev Luttrell +Lux Caddell +Davontae Scheller +Azari Soule +Yovani Jordon +Mauricio Guy +Paityn Do +Hennessey Mccammon +Ceasar Burlingame +Paulina Crocker +Dresden Pitcher +Tariq Bergstrom +Annabel Sykes +Simone Healy +Camden Fine +Emelie Sanmiguel +Emelyn Haller +Emmaleigh Razo +Lucio Clarkson +Kyro Haughton +Marlie London +Sachi Creek +Sirena Hom +Demarco Covert +Melanny Mayorga +Harlowe Walley +Patrick Stanley +Kitai Bing +Zissy Barrington +Kailey Delaney +Shekinah Hulett +Hernan Howes +Sutton Sorenson +Ayumi Brockett +Harini Fulks +Saylor Snapp +Hendrix Burson +Yehoshua To +Paulo Bare +Rhian Highsmith +Jeffrey Carey +Jordany Wingert +Arda Bilbrey +Katiana Mosely +Wendell Amin +Alexxa Schuman +Atarah Maravilla +Sima Grimsley +Kasen Ritter +Jakson Bancroft +Avigayil Kennon +Kiersten Tobias +Klynn Wolters +Blakeley Whiteman +Hudson Perry +Bentlee Houser +Leasia Urquhart +Kyngston Tingle +Dayana Hatcher +Alivia Osborne +Savana Thomsen +Rainier Corpuz +Leeanna Sikora +Emili Brainard +Carlo Curley +Xavien Cataldo +Kelani Cunha +Teagen Shamblin +Alyssia Spell +Adrienne Ferris +Jamiya Pantoja +Kaydee Vanmeter +Bakari Krouse +Jarrod Mccurry +Grey Creighton +Truth Petit +Georgette Kucera +Maisie Mcgill +Dallin Bankston +Melisa Tarr +Analy Garrity +Christal Cardin +Prince Mcfarland +Kapri Ketcham +Kaliah Delvalle +Sahara Crider +Klarissa So +Harlen Palmieri +Atara Gaul +Kassandra Newsome +Laiklyn Geraci +Infinity Mcgaughey +Kamran Cordes +Ainhoa Arruda +Ariadne Biggs +Camora Huckabee +Lucian Stover +Lamiya Alejo +Morris Mundy +Carmen Knapp +Slade Scales +Roxie Jaquez +Pyper Helm +Keyla Purcell +Fenix Skiles +Axton Hand +Nayan Hargraves +Aadi Sim +Eva Weaver +Josalynn Shope +Vinny Markle +Rozlyn Hudak +Jaxyn Palazzo +Aryana Montano +Sanaya Mull +Braxtin Lampert +Kiarra Autrey +Aziah Muth +Jaylynn Whalen +Raizy Kohn +Margo Douglass +Kendal Kitchen +Martez Ledoux +Hilary Fender +Meila Edelman +Inara Dockery +Niomi Beachy +Essie Fanelli +Noemi Hurtado +Shmuel Guillory +Genevie Govea +Josefina Munguia +Christian Rivera +Declyn Bumpus +Carson Foss +Gibran Bevins +Alyssandra Nestor +Ricardo Cain +Ember Odonnell +Ahsan Falconer +Anushka Harrigan +Irma Trowbridge +Dario Thayer +Legend Cantu +Thaddeus Hammer +Bianca Hardin +Josilyn Aguinaga +Eli Creasy +Anvi Ginn +Caraline Borst +Danna Dotson +Melody Lyons +Evalee Dirks +Vanya Willman +Jeison Feliz +Dariana Lipscomb +Johnhenry Berge +Adrina Mancilla +Zlata Mellinger +Nicole Bush +Aminata Forster +Kayleigh Stephenson +Clayton Buchanan +Rylin Czarnecki +Giovanna Regan +Zakariya Turley +Job Lemay +Kelcie Quimby +Aariyah Marley +Braydon Arthur +Hadlee Coates +Leslie Ta +Kingston Montgomery +Jameson Parada +Misa Birnbaum +Scotlyn Totten +Roslynn Georges +Elisia Brunelle +Darrien Larocca +Neala Presnell +Cydney Breckenridge +Mikah Jain +Brionna Colucci +Jarell Delano +Adelle Pinkerton +Yassin Coward +Brenda Lilly +Shemar Mciver +Hisham Farlow +Maida Guyer +Savior Revis +Liberty Quintana +Eleen Alfano +Fiona Logan +Jezebel Dake +Nihal Lavallee +Nivea Brook +Marla Pride +Kaylyn Oswald +Zamir Farrar +Eli Wood +Kacy Kreider +Niall Tyrrell +Jannat Ammons +Soledad Seng +Emina Loney +Mayleigh Burcham +Iona Iniguez +Oden Moorman +Jay Villa +Jeimy Caplan +Adriana Curry +Maxine Keating +Brynna Pinson +Julian Rogers +Aslan Jeanbaptiste +Aniston Bustos +Charlea Peguero +Atlas Slater +Jarred Shaner +Corinne Reece +Jazaria Mccusker +Aloni Flower +Aniylah Koester +Lamont Marvin +Stockton Chalmers +Honor Pauley +Kourtney Pimentel +Christabel Schuller +Zahara Cheney +Janiyla Culberson +Shaniyah Weimer +Maram Willette +Bowie Dingman +Emre Mckinzie +Dalyla Kindred +Jaydah Nelms +Riyah Haygood +Jaythan Martineau +Mari Harbin +Carlton Mazur +Kenslee Flick +Magali Corbitt +Paxtyn Bye +Rubi Upton +Abdulrahman Valdivia +Susan Ma +Yisroel Hearn +Rudy Bauman +Ayla Houston +Saul Lehman +Aric Rounds +Sunshine Milne +Annemarie Mcfarlane +Belinda Stearns +Mackson Pitchford +Analeah Scholl +Gretchen Hills +Shilah Peachey +Trayvon Hutcherson +Jacory Ober +Vansh Alegria +Immanuel Light +Kamya Volpe +Jenna Hensley +Kirby Witkowski +Jariah Partida +Shreya Edmondson +Akash Forest +Kaelan Medellin +Sultan Oaks +Jomar Chartier +Maher Rashid +Constantine Peebles +Caeli Cai +Camille Montoya +Unknown Toy +Danyla Percy +Marlyn Aucoin +Maricruz Dail +Maylen Gartner +Ronen Stitt +Silvano Preece +Easten Prevost +Lake Hagler +Cody Gu +Tierney Banner +Chancellor Hutchings +Mehmet Galaviz +Joab Kapp +Aylen Bromley +Aisha Andersen +Eimy Riojas +Mackayla Mceachern +Ione Lamoureux +Anyiah Tapley +Kala Mastin +Demetrius Schmitz +Zophia Shrum +Isha Sebastian +Anay Canty +Madigan Osterman +Mollie Yanez +Keeva Litchfield +Milly Wimberly +Akshay Whiteley +Yahel Barnwell +Daphney Charleston +Kenyon Heim +Cian Myles +Kynslee Reich +Wyatt Evans +Faizan Boice +Tommie Montalbano +Kylynn Veal +Cason Joyce +Marie Mcdermott +Saylor Cano +Roberto Santana +Annalie Chiang +Emett Grill +Valor Morehead +Aayla Sotomayor +Ayala Lower +Harris Seals +Emari Hovey +Amin Iglesias +Cayden Dennis +Ada Berger +Braylie Schutte +Brea Fogle +Ahna Geist +Jerzey Nemec +Amaru Depasquale +Kinleigh Irving +Amauri Broome +Torin Fraley +Allena Durante +Abhiram Heffernan +Champion Honea +Brayla Krawczyk +Genavieve Lipp +Gwendolyn Michael +Jaylin Yost +Matilda Justice +Seraphina Pyle +Grey Schrader +Madilynne Tunstall +Kenzington Ong +Alisa Keen +Emilly Moffatt +Evans Soucy +Kaylin Jamison +Echo Pfeifer +Brysen Weiner +Deasia Padron +Iman Laureano +Jean Jeter +Larissa Calloway +Willa Krause +Adeline Leonard +Darian Eddy +Aylin Kerr +Aidan Vazquez +Jaxson Ruiz +Mitchell Ventura +Cari Beacham +Sailor Bey +Payden Bisson +Lelani Desalvo +Octavious Lorenzen +Hardy Jaworski +Samya Cobbs +Jaziah Buie +Josie Colon +Alexandros Wayman +Brookelynn Gatlin +Aahil Oden +Nivaan Ruble +Shulem Pagel +Bronson Bowles +Haley Horn +Madison Nelson +Riggs Trainor +Yanely Cedillo +Tyshawn Keeling +Greyson Pirtle +Zakiya Guffey +Alannah Jeffries +Maci Randall +Savion Dupont +Devin Lara +Elma Tai +Annalicia Wanner +Roderick Wakefield +Meghan Burroughs +Hogan Santangelo +Race Marini +Solomon Calhoun +Everlee Pappas +Kaiden Dalrymple +Luiz Reinert +Joesph Berardi +Lenin Schumann +Mishka Bowes +Joanna Parrish +Samiah Jara +Jordan Powell +Adalia Colburn +Haylen Midkiff +Kenlie Halpern +Travon Hoag +Aadyn Bakke +Jurgen Elia +Jusiah Cranston +Elodie Schwarz +Karalyn Boulware +Jariel Schiller +Mackenzy Ippolito +Kade Reilly +Kinley Yates +Omari Britt +Allyanna Swinford +Nikolay Ferrier +Rex Swenson +Tyrone Huston +Bryer Mclemore +Alayah Mayfield +Zaydee Paulin +Khalif Spina +Essa Vannoy +Ehan Celestine +Yaniel Shockey +Mailen Yung +Jovanna Marmolejo +Taytum Obrian +Athalia Serafin +Valentine Pedigo +Timur Thrower +Khole Scribner +Wisdom Raab +Deonna Mulholland +Hayleigh Dias +Cai Trice +Katie Booth +Jeancarlos Camargo +Hayes Bradberry +Betsy Bethea +Jamaria Hardiman +Arlyn Constantine +Lenore Roderick +Zarah Villasenor +Arionna Slocum +Yelena Kight +Marion Anguiano +Lucero Noll +Maverick Vaughn +Karsen Dasilva +Elissa Randle +Eesha Arbuckle +Giovanni George +Stellan Wofford +Alayia Hendley +Avyana Sly +Kalliope Gingerich +Aksel Menard +Braden Fry +Aalayah Fiedler +Finn Dougan +Dirk Delcastillo +Ashton Austin +Pranavi Delcid +Banner Pepin +Rudolph Loudermilk +Elektra Schuette +Naiara Carillo +Jairo Whittington +Jalisa Muro +Benny Parry +Gabriela Mckenzie +Rick Chou +Leopold Strain +Christen Marcano +Aavya Rachal +Monserrath Liao +Aalyah Collis +Azael Elrod +Rima Moncrief +Favour Mcgann +Leiana Babbitt +Kitana Guido +Matai Esteves +Jaclyn Babb +Johanna Marino +Aleyah Barksdale +Jori Griner +Fannie Brister +Camia Revell +Jaynee Stamp +Lars Gilbertson +Johana Cable +Haisley Cantwell +Genesys Poteat +Wolf Jacks +Destin Birch +Brissa Batson +Darrion Salomon +Landry Mccollum +Kaylinn Sharon +Rooney Middlebrooks +Anilah Willhite +Dylann Marchant +Amoura Mauk +Gabby Deming +Kevin Stevens +Jaden Kingsley +Zariah Vang +Jariyah Donato +Malique Lovelady +Payden Langan +Joseangel Makowski +Elin Mcneal +Briar Dukes +Daryl Pease +Josemaria Embrey +Iyanna Carrera +Zaliyah Verduzco +Lielle Linkous +Kirill Garretson +Julien Meier +Eldon Fell +Gittel Mcculley +Calee Gasca +Devonte Warden +Shaurya Parkinson +Rashaun Hammon +Landen Khan +Jensen Mayer +Revan Renaud +Ayra Lashley +Galileah Blaney +Simeon Orellana +Aela Rayford +Shaniya Marx +Neriah Rushing +Aron Lovell +Desmond Shannon +Dempsey Luckett +Reyli Karns +Aidan Vos +Bliss Berglund +Ayda Dorr +Landrie Gower +Leighton Daugherty +Favor Dupuy +Maelee Chew +Hilario Casella +Japheth Massaro +Marilynn Quesada +Acelyn Lavery +Brynnlee Neuman +Kelis Munn +Aidyn Lima +Lake Marler +Xaria Almaguer +Bryant Grady +Legacy Wooley +Scarlett Richardson +Ever Dexter +Alessandro Payton +Zaniah Palacio +Marlo Blessing +Amiliana Palazzolo +Vivian Wheeler +Daylin Bay +Arya Schulze +Jazzlyn Pruett +Dominique Talbert +Esmee Chinn +Easton Hammock +Justice Hanna +Mylo Belton +Elloise Arzate +Martina Grissom +Skyler Castaneda +Fermin Peden +Lucien Bouchard +Bradleigh Karim +Edan Kowalczyk +Kalayah Mick +Dominik Quick +Oluwadarasimi Prickett +Viola Coughlin +Avrie Bogle +Veronica Blankenship +Luka Moser +Alyson Plummer +Wynn Dillman +Kinzleigh Lapierre +Railey Simonsen +Cayleigh Deguzman +Ted Widener +Judson Benedict +Lily Reyes +Vihaan Ervin +Laura Ibarra +Arleen Millar +Brookelyn Schoonover +Kailah Chrisman +Shivam Grose +Shrey Frederickson +Gianni Godfrey +Kenadee Armijo +Francisca Cannady +Willard Beane +Jaiyana Hoggard +Rayna Pierre +Ramona Paris +Ellanor Fenwick +Zenaida Huckaby +Dev Luttrell +Ari David +Jenna Hensley +Gabe Joe +Ty Bolton +Atlas Slater +Aubreigh Fabian +Yvette Clancy +Sparrow Plascencia +Adabelle Kyser +Brinkley Pomeroy +Gracen Haase +Francesco Chun +Rayah Steinke +Kenzleigh Logue +Abran Canaday +Egan Vizcarra +Alexandru Alpert +Aubrielle Sprague +Artem Donner +Carrie Fennell +Kalissa Murdoch +Antonia Kiser +Ariel Becker +Zayvian Paradise +Lawson Church +Elowen Landes +Rosalinda Fleck +Belinda Stearns +Ari Sumner +Halie Stella +Keshaun Batt +Agnes Hinds +Alexah Lark +Zakiya Guffey +Glory Peak +Markell Bianco +Gitty Gooden +Emri Coomer +Amna Palm +Jamar Loomis +Kyla Leach +Skylar Billings +Niyla Yaeger +Scarlette Heard +Lacy Trout +Nataliya Lovely +Leora Bowens +Shae Ayres +Mahogany Rupert +Brynna Pinson +Oziel Meister +Reeve Viramontes +Auriella Minnich +Divina Bergmann +Lukah Agosto +Ameir Honaker +Braylie Schutte +Iliana Melvin +Kwame Penland +Alayia Hendley +Hogan Santangelo +Mckenzee Go +James Taylor +Christen Yoshida +Colston Battaglia +Azariah Sewell +Emran Kwak +Dafne Viera +Immanuel Light +Kainan Nero +Aleigha Brenner +Mordecai Gosselin +Teodoro Peer +Yareni Deel +Nasya Loring +Ivey Ashworth +Anisha Alcaraz +Anneliese Venegas +Janylah Kempf +Brayden Sullivan +Zaine Kunkel +Sloan Quiles +Talia Farrell +Coy Benner +Mayleen Toussaint +Amora Culver +Vito Dunne +Raheem Leavitt +Glen Gerard +Trisha Stull +Zacharia Neiman +Calvin Chambers +Jencarlos Showalter +Elloise Arzate +Anastacia Ambriz +Alexi Hoyer +Safwan Treece +Flavio Natividad +Deborah Bower +Freya Mcmahon +Catelyn Hawkes +Melanny Mayorga +Pascual Scheel +Jamieson Armentrout +Lillee Slayton +Hayes Bradberry +Danyelle Gama +Dariah Adamski +Ryley Ahn +Elida Omar +Sherry Lear +Maizey Hector +Onna Bednar +Kobe Langley +Eliyah Bethel +Sky Hendrick +Davin Stjohn +Meir Greenfield +Eliab Slavin +Jolina Pelfrey +Andi Pick +Allee Strasser +Carolynn Mincey +Mackenzi Oceguera +Leana Knudson +Demond Harness +Fallon Henning +Mirabella Mccleary +Naya Whaley +Dennis Albert +Wynn Kuhns +Maida Guyer +Bowie Lombard +Abbigail Jung +Whitlee Kile +Nino Sites +Abril Dobson +Briasia Pletcher +Ellah Mumford +Elena Dean +Marlowe Schilling +Loretta Ojeda +Torrance Dinardo +Carissa Ha +Lia Mercado +Devante Loving +Tamya Gurrola +Kamdyn Platt +Otis Keys +Yuvraj Sadowski +Tanner Goodwin +Luisa Adamson +Layah Silvers +Kameron Abdullah +Nashley Bergin +Lea Jewell +Colter Beverly +Agastya Ballew +Jailah Brace +Campbell Foote +Louie Nagy +Erick Drake +Makiyah Coyne +Haven Doughty +Kyle Byrd +Denim Sarmiento +Olivier Bear +Corrina Blais +Cassia Wampler +Daven Benn +Devansh Osteen +Mischa Lafrance +Lillian Hughes +Ilah Bjork +Jakoby Burrow +Daizy Koger +Azaleah Farah +Nathen Fellows +Jakyla Labarge +Artur Harsh +Graeson Sabin +Kristyn Troup +Jeffrey Carey +Shanaya Callaway +Jackson Elbert +Evelyne Belknap +Malikai Osburn +Roosevelt Bigham +Jaiden Tom +Lakelyn Byler +Elias Rice +Dior Darden +Ainara Purnell +Amena Ernest +Alejandra Oconnell +Kyngston Tingle +Justyce Broderick +Abbygail Clevenger +Estevan Hawes +Truitt Feinberg +Lilyanne Guess +Tenlee Halvorsen +Milagro Yarnell +Henleigh Gillispie +Jeanna Trader +Thomas Cox +Najee Mcvicker +Carlie Cavanaugh +Jax Alvarenga +Mckinnley Kilby +Veer Kimmel +Chimamanda Napoli +Cozette Stonge +Ricki Bessette +Karsen Dasilva +Alain Alger +Jimmy Shirley +Audric Schmucker +Calee Gasca +Anila Lavine +Ingrid Benavides +Zahira Firestone +Dandre Shorter +Zephaniah Estrella +Analisa Frankel +Hernan Howes +Anna Marshall +Parks Juan +Amarion Brink +Braidyn Kroeger +Bushra Blackshear +Izabel Krebs +Amya Thomason +Clare Neely +Harli Dixson +Aubri Kincaid +Sabrina Barrera +Ernesto Carrasco +Crew Kraft +Sydnie Rost +Crimson Carruthers +Paxtyn Bye +Florence Sepulveda +Maddalyn Theisen +Maya Rose +Rahma Conlon +Royce Dale +Rio Evers +Cruz Bukowski +Lawton Campagna +Kamren Dupree +Eternity Partin +Walden Raymer +Jaretzy Chee +Yasmin Sheffield +Hadeel Hoeft +Donnie Conti +Omar Mclaughlin +Alexander Thomas +Messiah Farina +Holland Madrid +Nasir Mcfadden +Desmond Shannon +Gwendolyn Michael +Scout Madsen +Marshawn Ellington +Jaythan Martineau +Amaiah Kunze +Matilda Justice +Gabriela Mckenzie +Shaya Dacosta +Mariajose Sutter +Maysen Eckstein +Naisha Paulk +Jak Silvey +Silvana Guerin +River Villanueva +Ridley Carnahan +Divine Hassler +Rooney Middlebrooks +Raidyn Lepage +Perel Guadalupe +Kayleb Her +Johannah Merino +Cedar Kirchner +Samyah Oleson +Marbella Siler +Anabell Bustillos +Thang Constant +Kaysen Erdmann +Dayton Milton +Braelee Coots +Caitlyn Magana +Yadier Ingalls +Maiah Tobar +Mitchell Ventura +Anilah Willhite +Wyatt Evans +Devan Waldrop +Niles Carder +Alenna Gonsalez +Taiden Yocum +Zoi Brawner +Valentine Pedigo +Dalton Kane +Nihira Spiller +Seven Aitken +Everett Lawson +Markeith Mathewson +Abbey Rhoads +Aleen Boren +Abigail Lee +Delila Fee +Hanley Jun +Amari Davila +Mattison Vaccaro +Ivette Melson +Adian Fritsch +Carson Burns +Esma Eddings +Maiya Cornwell +Lennix Yap +Doris Derosa +Anjel Matus +Namir Lechuga +Callahan Gillen +Marietta Ebel +Naiomi Laroche +Jethro Huey +Amberly Lennon +Khaleel Dilorenzo +Taha Rohrer +Avyanna Barrows +Minka Cascio +Alston Tedesco +Delyla Mullaney +Khaza Hollar +Eldana Strang +Kelis Munn +Jazlyn Haney +Mahmoud Driggers +Laycee Stanger +Maniyah Warr +Lelani Desalvo +Chole Buckman +Krystal Valadez +Laniah Hake +Toryn Lozoya +Monica Corona +Richelle Standish +Brook Harwell +Christine Milligan +Ryah Mcnamee +Pax Lamont +Naeem Mapes +Embree Chisolm +Reagan Obrien +Analeigh Keel +Fredy Elliot +Ephraim Hawk +Aanvi Mader +Aralyn Klug +Arien Chafin +Rene Machado +Julian Rogers +Leeah Tolley +Maesyn Redfern +Jaxie Mccarroll +Dakarai Mccandless +Izzy Earls +Khalif Spina +Wilbert Lefler +Akshay Whiteley +Janiah Beaulieu +Aspen Prewitt +Ciana Schenck +Lavinia Prior +Nazareth Gast +Oumou Powe +Ryland Matney +Cheyann Serio +Shelton Lehr +Kailynn Pendleton +Mustafa Dumas +Tristyn Emanuel +Kacie Robledo +Amillia Crabb +Myer Maine +Blessyn Mertens +Elmer Trammell +Kerry Cumming +Marisa Kelleher +Lebron Elledge +Lyric Chase +Emersyn House +Ember Odonnell +Mckenzi Alberts +Tymber Stapp +Adolfo Montanez +Louella Corso +Nomar Works +Analy Garrity +Arius Dvorak +Rishabh Rehm +Sybil Amaral +Makaela Ducharme +Khai Felt +Aariz Dionne +Anushka Harrigan +Cayman Lineberry +Shaelyn Wilhite +Meena Blumberg +Alli Dube +Jamyla Runkle +Myanna Gaudette +Kolbi Doster +Taylar Pegram +Steele Scroggins +Adelise Sabol +Zailey Lenhart +Zionna Harshman +Eshan Siebert +Kirby Witkowski +Erabella Mcclean +Malakhi Luong +Courtland Haworth +Lila Gallagher +Jael Whatley +Campbell Canfield +Kambree Mazza +Tevin Bair +Bodhi Lake +Tenley Vo +Kalayah Mick +Jaiden Morton +Louisa Quiroz +Caydon Tollefson +Adlee Derr +Maddison Berg +Caidyn Armas +Kinzie Furr +Zania Willison +Justyce Rugg +Madilynn Hays +Reynaldo Forrester +Cason Joyce +Saydee Lightfoot +Rivan Tennison +Brea Fogle +Lamiya Alejo +Alberto Fink +Bradlee Dykstra +Emery Coulter +Gilbert Mcnair +Ida Bonds +Crawford Doane +Sam Connor +Samaria Amaro +Elli Ripley +Martin Burnett +Kansas Mcadoo +Darren Holcomb +Karsten Bussey +Janet Dubose +Braven Folk +Affan Savino +Zebadiah Birdsall +Ammy Garduno +Adore Callan +Kaliyah Espinosa +Sammy Brockman +Finnegan Harding +Sirena Hom +Shulem Pagel +Zoya Donohue +Yuri Teel +Andromeda Kuo +Jahiem Resnick +Lennox Lancaster +Rozlyn Hudak +Unknown Fant +Alonzo Lugo +Sabina Loy +Emre Mckinzie +Braiden Moseley +Kaison Thorpe +Roslyn Mcdonnell +Arial Mcsweeney +Alijah Forbes +Berlyn Aston +Zaara Lagunas +Jakhari Simmonds +Rhema Giddings +Zalayah Sessoms +Jazlynn Baez +Kenedi Holladay +Kavin Hernandes +Leonidas Cramer +Amberlee Carlile +Mackinley Hamner +Ocean Whitlow +Jasai Waring +Adien Sankey +Lamar Wyrick +Blen Dunston +Madeleine Shields +Vincenzo Duong +Braydan Lussier +Rohen Cusack +Emmi Castleberry +Jasmina Lambeth +Jakub Ritchey +Taylen Thorp +Kaidyn Hartzell +Leasia Urquhart +Zyra Hadden +Elynn Galli +Violet Washington +Nadia Kemp +Mathias Downing +Teagan Conner +Avalina Polson +Jrue Killion +Katlyn Fouts +Kason Conrad +Honor Pauley +Bryant Grady +Inara Dockery +Jc Ronan +Anasophia Dehaan +Della Coy +Natalie Myers +Mavrick Harold +Brooke Miles +Rihanna Foy +Misty Fitts +Quincey Boots +Dax Ritchie +Kianna Moua +Lazaro Welker +Nivea Brook +Ron Ousley +Austen Malik +Jameria Lipinski +Avraham Lauer +Zadie Whelan +Ayomide Bash +Suri Carlos +Raygen Gamache +Tydus Beggs +Maxim Goodrich +Dempsey Stivers +Jin Eades +Olliver Setzer +Irvin Minter +Odalys Salmeron +Blythe Ceja +Maryanna Turek +Tyriq Richburg +Paisley Harrison +Donte Wing +Sonja Creamer +Javen Cone +Krishna Sword +Arda Bilbrey +Collette Aldana +Mattilyn Dills +Izabell Colton +Aubre Roop +Zuriel Krohn +Tryston Janson +Charleston Zook +Arman Hoyle +Kaybree Mozingo +Scarlet Sloan +Akshaya Breault +Esdras Parkhurst +Rochelle Pitre +Lochlyn Athey +Jasir Aronson +Bria Garland +Charity Stauffer +Blade Garces +Mikaila Merriweather +Kierra Fontaine +Kayah Jesse +Siena Abraham +Theodora Fort +Samia Zhao +Brithany Lazar +Ulises Flood +Nikayla Ottinger +Zaden Soria +Keelan Qualls +Ahri Gillett +Marlei Marker +Myracle Theis +Abraham Powers +Lilith Oneil +Analiese Sonnier +Ethaniel Gerhart +Eiley Collum +Kaylana Arney +Jannah Moy +Abubakr Cantor +Nikhil Lively +Yulissa Plunkett +Keelyn Spahr +Sebastien Smalls +Jaida Roper +Tory Shropshire +Cooper Peyton +Jayli Rhine +Anapaula Cann +Bram Dever +Dusty Thompkins +Aubrianna Hathaway +Elva Roebuck +Michaella Adamo +Skylah Morrissey +Victoria Gomez +Bryn Scruggs +Earl Kong +Nikolai Carney +Gisele Rains +Rikki Miley +Emmet Peoples +Chad Hagan +Jaron Regalado +Amaria Rauch +Dayron Salguero +Yael Chavis +Deliah Laine +Laniyah Barbour +Kim Mckeown +Aleksandra Duenas +Kenna Roe +Abram Howe +Spirit Marrone +Ralph Muhammad +Waleed Arreguin +Armani Beatty +Karver Swart +Pablo Mahoney +Slater Gao +Hayslee Lampley +Antonella Corley +Reid Knopp +Elize Hamlet +Kahli Adames +Katalina Beaver +Issac Boggs +Jamison Puga +Haneen Rome +Levi Blaine +Aira Telford +Bryer Mclemore +Sanad Pearlman +Oliviana Ranson +Jaceion Houk +Sana Daily +Archie Easter +Adamaris Snook +Keyonna Herren +Gabriel Futrell +Keagan Koehler +Story Mckenney +Joey Bassett +Bosco Lieb +Errol Haugh +Ripley Bolen +Koen German +Damya Kirksey +Savanah Zheng +Maddox Foltz +Jasmine Mccoy +Balian Lindholm +Olivia Johnson +Geronimo Conant +Marko Hardman +Ranya Pickle +Ara Ovalle +Teagan Power +Zoha Mcshane +Devon Paez +Seerat Desilva +Keasia Aho +Ellis Diehl +Santana Corcoran +Malea Scofield +Cree Suzuki +Ayat Rahn +Marylou Crippen +Tim Denison +Sharon Landis +Laynie Hitt +Shiloh Saenz +Erion Tilson +Ben Miner +Caralyn Eichler +Kiley Bergeron +Oaklie Fulkerson +Jaceyon Mallard +Whitman Cater +Naveen Fast +Ebony Hubbell +Saniah Gilkey +Analucia Quiroga +Lyndi Giffin +Koa Nesbitt +Dominic Coleman +Athalia Serafin +Rolando Ham +Broderick Lytle +Adyson Palumbo +Lincoln Araujo +Jayana Orcutt +Alyx Yong +Shanti Berumen +Nataley Spielman +Kaitlin Griffiths +Caleah Hudspeth +Belen Sheldon +Cutter Collado +Kenzlee Sage +Canton Ice +Aili Sartin +Jamila Rawlings +Malik Morse +Makenna Nash +Maleigha Spruill +Kinlee Barrow +Sullivan Rambo +Jensen Lavender +Zyaire Stclair +Janine Chesser +Bintou Leader +Candice Searcy +Andy Gudino +Valarie Bartel +Kol Houseman +Aleah Woodward +Ailey Duque +Iain Barden +Cristopher Reagan +Samar Hazelwood +Jaslynn Mancuso +Skyelar Rhode +Angelie Steinmetz +Arlet Letourneau +Isabell Durbin +Reuben Keene +Alton Crawley +Paola Feldman +Ziona Baugher +Diane Basham +Lisandra Holsinger +Akil Mash +Hanah Beckmann +Laurynn Liss +Tierra Pelayo +River Deleon +Blakelee Rodarte +Soren Janke +Livvy Braley +Karam Bickford +Alaura Money +Ivan Bishop +Inayah Gailey +Izabelle Bellamy +Cotton Stiffler +Damario Hermes +Torrey Bosse +Meira Sellars +Laken Solorio +Tallulah Noonan +Tayler Fermin +Carol Freitas +Haleigh Brower +Kalleigh Sandstrom +Jaycee Mccants +Charissa Dice +Kaydin Justus +Mehki Hotchkiss +Elexis Roseberry +Exodus Voight +Jaxtyn Endicott +Julieta Wesley +Van Dickens +Jeffery Fonseca +Susannah Earnest +Catalia Vong +Maribel Aponte +Alexie Pompa +Maximilliano Hagedorn +Heavenlee Leech +Marion Ruvalcaba +Wanda Kenworthy +Nataleigh Sacco +Reyaan Kulp +Murphy Hargis +Octavian Berk +Baylee Mcconnell +Faithlynn Ullrich +Sedona Strother +Avielle Herald +Jerrick Casarez +Syed Oldham +Tennessee Hendon +Keona Kellam +Aleya Bivins +Nikole Chiles +Kanon Clary +Jancarlos Dana +Adriano Obryan +Felipe Engle +Theodore Mills +Amorette Cutting +Raizel Wendel +Jackelin Petrone +Zaida Fincher +Jayce Menchaca +Jaylinn Hammack +Brooklyn Mosqueda +Brittany Booker +Aiva Fairley +Asha Kelsey +Juel Holst +Janay Vanburen +Zelia Manes +Maritza Coats +Royal Steiner +Armand Herd +Nithya Beason +Elian Saucedo +Jolene Kay +Magali Corbitt +Zak Haile +Vera Wiggins +Jaxson Ruiz +Leliana Drumm +Jacelyn Bohannon +Khi Burkes +Braylen Valentine +Tylar Pray +Eniyah Mazzola +Nestor Skidmore +Symphony Hudgins +Kain Sell +Sapphira Mcmullin +Alec Zavala +Krue Victoria +Dariyah Nieman +Teegan Griego +Danthony Hochstetler +Terron Alleyne +Boden Kinsey +Evalynn Hirsch +Lillie Elder +Raylin Orosco +Wednesday Dollar +Evey Stackhouse +Maxton Christiansen +Cristina Whitt +Kandice Denmark +Tai Shine +Leighanna Eady +Treyson Lebron +Jules Wooden +Chana Pagan +Zavien Garfield +Izek Pelaez +Theresa Iverson +Nakiyah Bolick +Esmae Buehler +Gaia Zink +Albert Faulkner +Espen Breslin +Blayke Donofrio +Alana Wang +Ona Freitag +Lucus Dare +Kalvin Batista +Azalea Whitfield +Madisen Crittenden +Fabian Lam +Kahlani Berens +Kaylene Riddick +Treysen Kujawa +Rajon Spiker +Augustus Mcneil +Meelah Rossetti +Nickolas Hankins +Shepard Samson +Greer Moise +Alida Danko +Decker Maier +Ameen Nester +Blayden Quevedo +Isadora Cerda +Marco Callahan +Jovi Johnsen +Nikolay Ferrier +Nayla Blank +Nariah Pringle +Kyndell Kunkle +Ayman Ocasio +Akiva Huntington +Stirling Cardillo +Emonie Anson +Cattleya Poindexter +Karmelo Headrick +Weldon Sorto +Amy Joseph +Nicolette Lenz +Haydee Trusty +Starr Rey +Keandre Click +Reeves Cueva +Kasen Ritter +Kyler Burley +Gonzalo Askew +Taylor Mercer +Elaina Mathews +Brenner Rosenblum +Jaydee Pillow +Luiza Wilmot +Dea Enlow +Kennedi Mclean +Mauricio Guy +Lainey Blanco +Joshlynn Bowerman +Matt Islas +Lili Marston +Reggie Kinard +Diamond Mccollough +Darrick Ressler +Yehuda Hare +Kenslie Spikes +Amyla Howarth +Shyla Heredia +Giulietta Soper +Aminah Boucher +Ariya Sterling +Keiran Standridge +Kaleia Peckham +Adisyn Buckles +Imari Barahona +Elam Beckwith +Lailani Ashford +Graci Ascencio +Kyrell Pankey +Valerie Daniel +Shiv Stillwell +Finleigh Mears +Ahsan Falconer +Kapri Ketcham +Rafaela Raby +Cindy Greco +Ignatius Speck +Anisa Hiatt +Hadasa Gustin +Halen Boutin +Kynsley Hass +Dexton Widner +Kaliana Knighton +Halina Sowards +Kristopher Kirkpatrick +Bruno Painter +Alexandro Slattery +Magnus Stapleton +Santiago Vargas +Moksh Gulledge +Asya Hazzard +Massimo Kopp +Tea Boldt +Shriyan Sobel +Safiya Langer \ No newline at end of file diff --git a/Exam/IKT203Exam/DATA/songs.txt b/Exam/IKT203Exam/DATA/songs.txt new file mode 100644 index 0000000..04a6303 --- /dev/null +++ b/Exam/IKT203Exam/DATA/songs.txt @@ -0,0 +1,51 @@ +[records:=50] +Dire Straits;Love Over Gold;1984;rock;MusicBrainz +Dire Straits;Expresso Love;1984;rock;MusicBrainz +Dire Straits;Romeo and Juliet;1984;rock;MusicBrainz +Dire Straits;Telegraph Road;1984;rock;MusicBrainz +Dire Straits;Private Investigations;1984;rock;MusicBrainz +Dire Straits;Tunnel of Love (intro: The Carousel Waltz);1984;rock;MusicBrainz +Dire Straits;Once Upon a Time in the West;1984;rock;MusicBrainz +Dire Straits;Going Home (theme from ‘Local Hero’);1984;rock;MusicBrainz +Ry Cooder;634-5789 (Soulsville, U.S.A.);1980;rock;MusicBrainz +Rush;The Body Electric;1984;rock;MusicBrainz +Rush;Afterimage;1984;rock;MusicBrainz +Rush;Kid Gloves;1984;rock;MusicBrainz +Rush;Red Lenses;1984;rock;MusicBrainz +Rush;Red Sector A;1984;rock;MusicBrainz +Rush;Between the Wheels;1984;rock;MusicBrainz +Barclay James Harvest;Say You’ll Stay;1984;rock;MusicBrainz +Dire Straits;Solid Rock;1984;rock;MusicBrainz +King Crimson;Model Man;1984;rock;MusicBrainz +King Crimson;No Warning;1984;rock;MusicBrainz +Queen;Tie Your Mother Down;1977;rock;MusicBrainz +The Long Ryders;(Sweet) Mental Revenge;1984;rock;MusicBrainz +Ry Cooder;Crazy ’bout an Automobile (Every Woman I Know);1980;rock;MusicBrainz +Hawkwind;Jack of Shadows;1979;rock;MusicBrainz +Kauko RöyhkÀ & Narttu;PÀhkinÀpuu;1984;rock;MusicBrainz +Kauko RöyhkÀ & Narttu;Tuulee;1984;rock;MusicBrainz +Echo & The Bunnymen;Seven Seas "Life At Brian's - Lean And Hungry";1984;rock;Discogs +Billy Squier;Signs Of Life;1984;rock;Discogs +Paul McCartney;No More Lonely Nights;1984;rock;Discogs +Body Checks;TÀtowiert + Kahlgeschoren;1984;rock;Discogs +Trust (2);Serre Les Poings;1984;rock;Discogs +Mama's Boys;Mama's Boys;1984;rock;Discogs +Def Leppard;High 'N' Dry;1984;rock;Discogs +Savage Republic;Tragic Figure;1984;rock;Discogs +The Icicle Works;The Icicle Works;1984;rock;Discogs +Twisted Sister;We're Not Gonna Take It;1984;rock;Discogs +The Pogues;The Boys From The County Hell;1984;rock;Discogs +The Takeaways;Sweet And Sour Volume 2;1984;rock;Discogs +Rick Springfield;Beautiful Feelings;1984;rock;Discogs +Vice Squad;Teenage Rampage;1984;rock;Discogs +The Vipers (4);Outta The Nest;1984;rock;Discogs +Rolands Gosskör;Genom BarriÀren;1984;rock;Discogs +Willie Loco Alexander*;Taxi-Stand Diane;1984;rock;Discogs +Kansas (2);The Best Of Kansas;1984;rock;Discogs +The Rolling Stones;30 Años De Musica Rock - Salvat;1984;rock;Discogs +Lindisfarne;Nicely Out Of Tune;1984;rock;Discogs +Andy Summers;2010 / To Hal And Back;1984;rock;Discogs +The Beatles;I Feel Fine;1984;rock;Discogs +Neil Diamond;Love Songs;1984;rock;Discogs +The Sensational Alex Harvey Band;Live;1984;rock;Discogs +Subterfuge (10);Who's The Fool;1984;rock;Discogs diff --git a/Exam/IKT203Exam/LibExample/CMakeLists.txt b/Exam/IKT203Exam/LibExample/CMakeLists.txt new file mode 100644 index 0000000..ddcd46e --- /dev/null +++ b/Exam/IKT203Exam/LibExample/CMakeLists.txt @@ -0,0 +1,32 @@ +# --- Step 1: Create the Library --- + +# Define a library target named "LibExample". +# We use INTERFACE because it only contains .hpp files (header-only). +# There are no .cpp files to compile here. +# TODO: Change to STATIC if you add .cpp files later. +add_library(LibExample INTERFACE) + +# --- Step 2: Add Header Files to the Library --- + +# This command explicitly lists the header files that belong to the library. +# This helps Visual Studio display them nicely in the Solution Explorer. +target_sources(LibExample + PUBLIC + list.hpp + TSingleLinkedListTemplate.hpp + TDoublyLinkedListTemplate.hpp + TCircularDoublyLinkedListTemplate.hpp + queue.hpp + stack.hpp +) + +# --- Step 3: Make Headers "Findable" --- + +# This is the most important command here. +# It tells any other project that links to "LibExample" to add this +# directory (CMAKE_CURRENT_SOURCE_DIR) to its list of include paths. +# This is what allows you to write #include "list.hpp" in your main.cpp. +# Note: CMAKE_CURRENT_SOURCE_DIR is a built-in variable that points to the directory +target_include_directories(LibExample INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +#TODO: Change INTERFACE to PUBLIC if you add .cpp files later. + diff --git a/Exam/IKT203Exam/LibExample/TCircularDoublyLinkedListTemplate.hpp b/Exam/IKT203Exam/LibExample/TCircularDoublyLinkedListTemplate.hpp new file mode 100644 index 0000000..22a670f --- /dev/null +++ b/Exam/IKT203Exam/LibExample/TCircularDoublyLinkedListTemplate.hpp @@ -0,0 +1,454 @@ +// Implantation of the Circular Doubly Linked List + +#ifndef TCIRCULARDOUBLYLINKEDLISTTEMPLATE_HPP +#define TCIRCULARDOUBLYLINKEDLISTTEMPLATE_HPP +#pragma once + +#include "TDoublyLinkedListTemplate.hpp" + +template +class TCircularDoublyLinkedList : public TDoublyLinkedList { +private: + + // Helper to remove a node, updating both next and prev pointers + void InternalRemoveNode(TNode* aNodeToDelete); + +protected: + // --- New Member Variable --- + TNode* cursor; // Points to the "current" node in the list. + +public: + using TSingleLinkedList::Append; + using TSingleLinkedList::Prepend; + + // --- Constructor & Destructor --- + TCircularDoublyLinkedList(bool aIsDataOwner); + virtual ~TCircularDoublyLinkedList() override; + + // --- New Cursor Management Methods --- + void ResetCursor(); + T GetCursorData() const; + void AdvanceCursor(int aSteps = 1); + void RewindCursor(int aSteps = 1); + int GetCursorIndex() const; + + + // --- Overridden Virtual Methods --- + // For maintaining the circular link + void Append(const T&) override; + void Prepend(const T&) override; + void Remove(const T&) override; + void RemoveAll(const T&) override; + T RemoveLast() override; + void Reverse() override; + void ReverseSublist(int, int) override; + void Merge(TSingleLinkedList& otherList) override; + + // For avoiding infinite loops + bool Contains(const T&) const override; + T Search(const T&, FCheckNode) const override; + void ForEach(FVisitNode) const override; + TNode* GetMiddle() const override; +}; + +// Constructor: Establishes the initial circular link where the head points to itself. +template +TCircularDoublyLinkedList::TCircularDoublyLinkedList(bool aIsDataOwner) + : TDoublyLinkedList(aIsDataOwner) { + // An empty circular list's dummy head points to itself. + this->head->SetNext(this->head); + this->head->SetPrev(this->head); + this->cursor = this->head; // Cursor also starts at the head. +} + +// Destructor: The parent destructors are virtual and will handle cleanup. +template +TCircularDoublyLinkedList::~TCircularDoublyLinkedList() { + // Before the parent destructors run, we must break the circular link. + // The parent's `nullptr`-terminated cleanup loop will now work correctly. + if (!this->IsEmpty()) { + // The tail is the node before the dummy head. + // Set its 'next' pointer to null instead of back to the head. + this->head->GetPrev()->SetNext(nullptr); + } + // Now, the chain is broken: head -> node1 -> ... -> tail -> nullptr + // The TDoublyLinkedList and TSingleLinkedList destructors will be called + // automatically after this, and they will now function correctly. +} + +// Moves the cursor to the first element in the list. +template +void TCircularDoublyLinkedList::ResetCursor() { + if (this->IsEmpty()) { + this->cursor = this->head; + } + else { + this->cursor = this->head->GetNext(); + } +} + +// Returns the data at the cursor's current position. +template +T TCircularDoublyLinkedList::GetCursorData() const { + // The cursor is only valid if it's not pointing to the dummy head. + if (!this->IsEmpty() && this->cursor != this->head) { + return this->cursor->GetData(); + } + return nullptr; +} + +// Moves the cursor forward, wrapping around if needed. +template +void TCircularDoublyLinkedList::AdvanceCursor(int aSteps) { + if (this->IsEmpty()) { + return; + } + + for (int i = 0; i < aSteps; ++i) { + this->cursor = this->cursor->GetNext(); + // If we move to the dummy head, we've wrapped around. Skip over it to the first element. + if (this->cursor == this->head) { + this->cursor = this->head->GetNext(); + } + } +} + +// Moves the cursor backward, wrapping around if needed. +template +void TCircularDoublyLinkedList::RewindCursor(int aSteps) { + if (this->IsEmpty()) { + return; + } + + for (int i = 0; i < aSteps; ++i) { + this->cursor = this->cursor->GetPrev(); + // If we move to the dummy head, we've wrapped around. Skip over it to the last element. + if (this->cursor == this->head) { + this->cursor = this->head->GetPrev(); + } + } +} + +// Gets the numerical index of the cursor's current position. +template +int TCircularDoublyLinkedList::GetCursorIndex() const { + if (this->IsEmpty() || this->cursor == this->head) { + return -1; + } + + int index = 0; + TNode* current = this->head->GetNext(); + + // Traverse the list safely, knowing it will eventually loop back to the head. + while (current != this->head) { + if (current == this->cursor) { + return index; + } + current = current->GetNext(); + index++; + } + + return -1; // Should not be reached if cursor is valid. +} + +// Appends a node to the end of the list (before the dummy head). +// Use the InternAppend from TDoublyLinkedList for basic logic, then adjust prev pointers. +template +void TCircularDoublyLinkedList::Append(const T& aData) { + // 1. Let the base class do ALL the standard work. + TDoublyLinkedList::Append(aData); + // 2. Now fix the circular links. + if(!this->IsEmpty()) { + this->head->SetPrev(this->tail); // Dummy head's prev points to new tail + this->tail->SetNext(this->head); // New tail's next points to dummy head + } +} + +// Prepends a node to the beginning of the list (after the dummy head). +// Use the Prepend from TDoublyLinkedList, this will handle all the logic. +template +void TCircularDoublyLinkedList::Prepend(const T& aData) { + TDoublyLinkedList::Prepend(aData); + // No need to adjust circular links, as TDoublyLinkedList::Prepend already does it. +} + + +template +void TCircularDoublyLinkedList::InternalRemoveNode(TNode* aNodeToDelete) { + if (aNodeToDelete == nullptr || aNodeToDelete == this->head) return; // Invalid input + + // 1. Update cursor if it points to the node being deleted + if (this->cursor == aNodeToDelete) { + this->cursor = aNodeToDelete->GetNext(); + } + + //2. Update tail if the last node is being removed + if (aNodeToDelete == this->tail) { + this->tail = aNodeToDelete->GetPrev(); + } + + // 3. Relink neighbors (this maintains the circle automatically) + TNode* prevNode = aNodeToDelete->GetPrev(); + TNode* nextNode = aNodeToDelete->GetNext(); + prevNode->SetNext(nextNode); + nextNode->SetPrev(prevNode); + + // 4. Delete data if owned, then delete the node + if (this->isDataOwner) { + delete aNodeToDelete->GetData(); + } + delete aNodeToDelete; + this->size--; + + // 5. If the list is now empty, ensure tail and cursor point to the head. + if (this->IsEmpty()) { + this->tail = this->head; + this->cursor = this->head; + } +} + +// Removes the first node with the given value. +template +void TCircularDoublyLinkedList::Remove(const T& aData) { + if (this->IsEmpty()) return; + + // Start searching from the first actual node + TNode* current = this->head->GetNext(); + // Traverse the entire circle once + for (int i = 0; i < this->size; ++i) { + if (current->GetData() == aData) { + TNode* prevNode = current->GetPrev(); + TNode* nextNode = current->GetNext(); + + // Update tail if the last node is being removed + if (current == this->tail) { + this->tail = prevNode; + } + + // Relink neighbors (this maintains the circle automatically) + prevNode->SetNext(nextNode); + nextNode->SetPrev(prevNode); + + if (this->isDataOwner) { + delete current->GetData(); + } + delete current; + this->size--; + return; + } + current = current->GetNext(); + } +} + +// Removes the last element from the list. +template +T TCircularDoublyLinkedList::RemoveLast() { + if (this->IsEmpty()) { + return nullptr; + } + + TNode* nodeToRemove = this->tail; + T dataToReturn = nodeToRemove->GetData(); + TNode* newTail = nodeToRemove->GetPrev(); + + // Relink the new tail to the head to maintain the circle + newTail->SetNext(this->head); + this->head->SetPrev(newTail); + + this->tail = newTail; // Update tail pointer + + delete nodeToRemove; + this->size--; + + if (this->IsEmpty()) { + this->tail = this->head; // Reset tail if list is now empty + } + + return dataToReturn; +} + +// Removes all occurrences of a given value using a safe, bounded loop. +template +void TCircularDoublyLinkedList::RemoveAll(const T& aData) { + if (this->IsEmpty()) return; + + TNode* current = this->head->GetNext(); + int initialSize = this->size; // Loop based on the original size + + for (int i = 0; i < initialSize; ++i) { + TNode* nextNode = current->GetNext(); // Get next node before potential deletion + + if (current->GetData() == aData) { + TNode* prevNode = current->GetPrev(); + + if (current == this->tail) { + this->tail = prevNode; + } + + prevNode->SetNext(nextNode); + nextNode->SetPrev(prevNode); + + if (this->isDataOwner) { + delete current->GetData(); + } + delete current; + this->size--; + } + current = nextNode; + } + if (this->IsEmpty()) { + this->tail = this->head; + } +} + +// Reverses the entire list by swapping the next/prev pointers of every node. +template +void TCircularDoublyLinkedList::Reverse() { + if (this->size <= 1) return; // Nothing to reverse + + // 1. Keep track of original head and tail nodes. + TNode* newFirstNode = this->tail; + + // 2. Iterate through all nodes, swapping next and prev pointers. + TNode* current = this->head; + // We must loop size + 1 times to include the dummy head in the pointer swap. + for (int i = 0; i < this->size + 1; ++i) { + current->SwapNextPrev(); + // The *new* prev pointer is the *original* next pointer, so this moves us forward. + current = current->GetPrev(); + } + + // 3. Correct the head and tail pointers. + this->tail = this->head->GetNext(); // The old head is the new tail. + this->head->SetNext(newFirstNode); // The dummy head now points to the old tail. + newFirstNode->SetPrev(this->head); // New first node's prev points to dummy head. +} + +// Reverses a portion of the list, ensuring circular links are maintained. +template +void TCircularDoublyLinkedList::ReverseSublist(int start, int end) { + if (start < 0 || end >= this->size || start >= end) { + return; + } + + // --- 1. Find boundary nodes --- + TNode* startNode = this->head->GetNext(); + for (int i = 0; i < start; ++i) { + startNode = startNode->GetNext(); + } + + TNode* endNode = startNode; + for (int i = start; i < end; ++i) { + endNode = endNode->GetNext(); + } + + TNode* startPrev = startNode->GetPrev(); + TNode* endNext = endNode->GetNext(); + + // --- 2. Reverse pointers for all nodes within the sublist --- + TNode* current = startNode; + for (int i = 0; i <= (end - start); ++i) { + TNode* temp = current->GetNext(); + current->SetNext(current->GetPrev()); + current->SetPrev(temp); + current = temp; + } + + // --- 3. Re-stitch the sublist (no nullptr checks needed) --- + startPrev->SetNext(endNode); + endNode->SetPrev(startPrev); + startNode->SetNext(endNext); + endNext->SetPrev(startNode); + + // Update tail pointer if it was part of the reversed segment + if (this->head->GetPrev() == endNode) { // Original startNode is now at the end + this->tail = startNode; + } +} + +// Merges another sorted list, creating a single, sorted circular list. +template +void TCircularDoublyLinkedList::Merge(TSingleLinkedList& otherList) { + // We can call the parent implementation to do the heavy lifting of merging. + TDoublyLinkedList::Merge(otherList); + + // The parent merge results in a null-terminated list. We just need to fix the ends. + if (!this->IsEmpty()) { + TNode* firstNode = this->head->GetNext(); + this->tail->SetNext(firstNode); + firstNode->SetPrev(this->tail); + } +} + +// Applies a function to each node using a safe loop for a circular list. +template +void TCircularDoublyLinkedList::ForEach(FVisitNode aVisitNode) const { + if (aVisitNode == nullptr || this->IsEmpty()) { + return; + } + + TNode* current = this->head->GetNext(); + int index = 0; + while (current != this->head) { + aVisitNode(current->GetData(), index); + current = current->GetNext(); + index++; + } +} + +// Checks if a value is in the list using a safe, non-infinite loop. +template +bool TCircularDoublyLinkedList::Contains(const T& aData) const { + if (this->IsEmpty()) { + return false; + } + + TNode* current = this->head->GetNext(); + while (current != this->head) { + if (current->GetData() == aData) { + return true; + } + current = current->GetNext(); + } + return false; +} + +// Searches for a value using a safe, non-infinite loop. +template +T TCircularDoublyLinkedList::Search(const T& aData, FCheckNode aCheckNode) const { + if (this->IsEmpty()) { + return nullptr; + } + + TNode* current = this->head->GetNext(); + while (current != this->head) { + if (aCheckNode != nullptr) { + if (aCheckNode(current->GetData(), aData)) { + return current->GetData(); + } + } + else { + if (current->GetData() == aData) { + return current->GetData(); + } + } + current = current->GetNext(); + } + return nullptr; +} + +// Finds the middle node by traversing to the size/2 index. +template +TNode* TCircularDoublyLinkedList::GetMiddle() const { + if (this->IsEmpty()) return nullptr; + + // The safest way for a list where we know the size. + int middleIndex = this->size / 2; + TNode* current = this->head->GetNext(); + for (int i = 0; i < middleIndex; ++i) { + current = current->GetNext(); + } + return current; +} + +#endif // TCIRCULARDOUBLYLINKEDLISTTEMPLATE_HPP diff --git a/Exam/IKT203Exam/LibExample/TDoublyLinkedListTemplate.hpp b/Exam/IKT203Exam/LibExample/TDoublyLinkedListTemplate.hpp new file mode 100644 index 0000000..3a2e438 --- /dev/null +++ b/Exam/IKT203Exam/LibExample/TDoublyLinkedListTemplate.hpp @@ -0,0 +1,340 @@ +// TDoublyLinkedList implements a doubly linked list data structure with basic functionalities. + +#ifndef TDOUBLYLINKEDLISTTEMPLEATE_HPP +#define TDOUBLYLINKEDLISTTEMPLEATE_HPP +#pragma once +#include "TSingleLinkedListTemplate.hpp" + +// Doubly Linked List inheriting from TSingleLinkedList +template +class TDoublyLinkedList : public TSingleLinkedList { +private: + // Internal helper to remove a node, updating both next and prev pointers + void InternalRemoveNode(TNode* aNodeToDelete); + +public: + using TSingleLinkedList::Append; + using TSingleLinkedList::Prepend; + + // --- Constructor & Destructor --- + // Constructor calls the base class's constructor to initialize common members. + TDoublyLinkedList(bool aIsDataOwner); + + // The destructor is also virtual, ensuring the correct cleanup chain. + virtual ~TDoublyLinkedList() override; + + + // --- Overridden Virtual Methods from TSingleLinkedList --- + // These methods provide new implementations to manage the 'prev' pointer + // and/or to improve performance. + virtual void Append(const T&) override; + virtual void Prepend(const T&) override; + virtual T GetAtIndex(int) override; + virtual void Remove(const T&) override; + virtual void Reverse() override; + virtual void Merge(TSingleLinkedList&) override; + virtual void RemoveAll(const T&) override; + virtual void ReverseSublist(int, int) override; + virtual T RemoveLast(); + + + // --- New Methods Unique to TDoublyLinkedList --- + // These methods leverage the 'prev' pointer for capabilities that are + // inefficient or impossible in a singly-linked list. + + void InsertBefore(TNode*, T&); + void ForEachReverse(FVisitNode) const; +}; + + +template +inline void TDoublyLinkedList::InternalRemoveNode(TNode* aNodeToDelete) +{ + if (aNodeToDelete == nullptr || aNodeToDelete == this->head) return; + TNode* prevNode = aNodeToDelete->GetPrev(); + TNode* nextNode = aNodeToDelete->GetNext(); + if (prevNode != nullptr) { + prevNode->SetNext(nextNode); + } + if (nextNode != nullptr) { + nextNode->SetPrev(prevNode); + } + if (aNodeToDelete == this->tail) { + this->tail = prevNode; + } + if (this->isDataOwner) { + delete aNodeToDelete->GetData(); + } + delete aNodeToDelete; + this->size--; +} + +// Constructor: Calls the base class constructor to perform initialization. +template +TDoublyLinkedList::TDoublyLinkedList(bool aIsDataOwner) + : TSingleLinkedList(aIsDataOwner) {} + +// Destructor: The base class destructor is virtual, so this is called automatically. +// No new resources were allocated, so the body can be empty. +template +TDoublyLinkedList::~TDoublyLinkedList() {} // No additional cleanup needed, the base class handles it. + +// Append: Overridden to correctly set the 'prev' pointer on the new node. +template +void TDoublyLinkedList::Append(const T& aData) { + TNode* oldTail = this->tail; + TNode* newNode = this->InternAppend(aData); + newNode->SetPrev(oldTail); // Set the new node's prev to the old tail +} + +// Prepend: Overridden to correctly set 'prev' pointers on the new node and its old neighbor. +template +void TDoublyLinkedList::Prepend(const T& aData) { + TNode* newNode = this->InternPrepend(aData); + newNode->SetPrev(this->head); // New node's prev points to dummy head + if (newNode->GetNext() != nullptr) { + newNode->GetNext()->SetPrev(newNode); // Old first node's prev points to new node + } +} + +// GetAtIndex: Re-introduces the performance optimization to search from the tail. +template +T TDoublyLinkedList::GetAtIndex(int aIndex) { + if (aIndex < 0 || aIndex >= this->size) { + return nullptr; // Index out of bounds + } + + TNode* current; + // Check which end is closer and traverse from there. + if (aIndex < this->size / 2) { + current = this->head->GetNext(); + for (int i = 0; i < aIndex; i++) { + current = current->GetNext(); + } + } + else { + current = this->tail; + for (int i = this->size - 1; i > aIndex; i--) { + current = current->GetPrev(); + } + } + return current->GetData(); +} + +// Remove: Removes all nodes matching the given value. +template +void TDoublyLinkedList::Remove(const T& aData) { + TNode* current = this->head->GetNext(); + while (current != nullptr) { + if (current->GetData() == aData) { + TNode* nodeToRemove = current; + current = current->GetNext(); // Move current forward before deletion + InternalRemoveNode(nodeToRemove); + } + else { + // No match, just advance current + current = current->GetNext(); + } + } +} + +// Reverse: Uses the much simpler algorithm of swapping prev/next pointers. +template +void TDoublyLinkedList::Reverse() { + if (this->size <= 1) return; + + // 1. Keep track of original head and tail nodes. + TNode* originalHeadNode = this->head->GetNext(); + TNode* originalTailNode = this->tail; + + // 2. Swap prev/next for every node. + TNode* current = originalHeadNode; + while (current != nullptr) { + current->SwapNextPrev(); + // The *new* prev pointer is the *original* next pointer, so this moves us forward. + current = current->GetPrev(); + } + + // 3. Correct the pointers for the new head and tail. + this->tail = originalHeadNode; // The old head is the new tail. + this->head->SetNext(originalTailNode); // The dummy head now points to the old tail. +} + +// RemoveLast: Removes the final element in O(1) time. +// Note: This returns the data, so the caller is now responsible for it. +// The data itself is not deleted, even if isDataOwner is true. +template +T TDoublyLinkedList::RemoveLast() { + if (this->IsEmpty()) { + return nullptr; + } + + TNode* nodeToRemove = this->tail; + T dataToReturn = nodeToRemove->GetData(); + + this->tail = this->tail->GetPrev(); + this->tail->SetNext(nullptr); + + delete nodeToRemove; + this->size--; + + return dataToReturn; +} + +// InsertBefore: Inserts a new node before a specified node in O(1) time. +template +void TDoublyLinkedList::InsertBefore(TNode* aNode, T& aData) { + if (aNode == nullptr || aNode == this->head) { + // Cannot insert before a null node or the dummy head + return; + } + + // If inserting before the first element, Prepend is easier. + if (aNode == this->head->GetNext()) { + Prepend(aData); + return; + } + + TNode* newNode = new TNode(aData); + TNode* prevNode = aNode->GetPrev(); + + // Link new node to its neighbors + newNode->SetPrev(prevNode); + newNode->SetNext(aNode); + + // Update neighbors to point to the new node + prevNode->SetNext(newNode); + aNode->SetPrev(newNode); + + this->size++; +} + +// ForEachReverse: Traverses the list backward from tail to head. +template +void TDoublyLinkedList::ForEachReverse(FVisitNode aVisitNode) const { + if (aVisitNode == nullptr) { + return; + } + TNode* current = this->tail; + int index = this->size - 1; + while (current != this->head) { + aVisitNode(current->GetData(), index); + current = current->GetPrev(); + index--; + } +} + +template +void TDoublyLinkedList::Merge(TSingleLinkedList& otherList) { + if (otherList.IsEmpty()) { + return; + } + + int otherSize = otherList.GetSize(); + // Call the now-public StealNodes to legally take ownership of the nodes. + TNode* p2 = otherList.StealNodes(); + + if (this->IsEmpty()) { + this->head->SetNext(p2); + if (p2) p2->SetPrev(this->head); + this->size = otherSize; + // Find the new tail by traversing. + TNode* newTail = this->head; + while (newTail->GetNext() != nullptr) { + newTail = newTail->GetNext(); + } + this->tail = newTail; + return; + } + + TNode* p1 = this->head->GetNext(); + TNode* currentTail = this->head; + + while (p1 != nullptr && p2 != nullptr) { + if (p1->GetData() <= p2->GetData()) { + currentTail->SetNext(p1); + p1->SetPrev(currentTail); + p1 = p1->GetNext(); + } + else { + currentTail->SetNext(p2); + p2->SetPrev(currentTail); + p2 = p2->GetNext(); + } + currentTail = currentTail->GetNext(); + } + + TNode* remainder = (p1 != nullptr) ? p1 : p2; + currentTail->SetNext(remainder); + if (remainder != nullptr) { + remainder->SetPrev(currentTail); + } + + this->size += otherSize; + // After merging, find the new tail by traversing from where we left off. + while (currentTail->GetNext() != nullptr) { + currentTail = currentTail->GetNext(); + } + this->tail = currentTail; +} + +// Remove: Removes all nodes matching the given value. +template +void TDoublyLinkedList::RemoveAll(const T& aValue) { + TNode* current = this->head->GetNext(); + while (current != nullptr) { + if (current->GetData() == aValue) { + TNode* nodeToRemove = current; + current = current->GetNext(); // Move current forward before deletion + InternalRemoveNode(nodeToRemove); + } + else { + // No match, just advance the pointer + current = current->GetNext(); + } + } +} + +// ReverseSublist: Reverses a portion of the list between two indices (inclusive). +template +void TDoublyLinkedList::ReverseSublist(int start, int end) { + if (start < 0 || end >= this->size || start >= end) return; + + // --- 1. Find boundary nodes --- + TNode* startNode = this->head->GetNext(); + TNode* endNode = startNode; + + for (int i = 0; i < start; ++i) { + startNode = startNode->GetNext(); + } + for (int i = start; i < end; ++i) { + endNode = endNode->GetNext(); + } + + TNode* startPrev = startNode->GetPrev(); + TNode* endNext = endNode->GetNext(); + + // --- 2. Reverse pointers for all nodes within the sublist --- + TNode* current = startNode; + while (current != endNext) { + TNode* temp = current->GetNext(); + current->SetNext(current->GetPrev()); + current->SetPrev(temp); + current = temp; // Move to the original next node + } + + // --- 3. Re-stitch the reversed sublist into the main list --- + startPrev->SetNext(endNode); + endNode->SetPrev(startPrev); + + startNode->SetNext(endNext); + if (endNext != nullptr) { + endNext->SetPrev(startNode); + } + else { + // If we reversed to the end, the original startNode is the new tail + this->tail = startNode; + } +} + +#endif // !TDOUBLYLINKEDLISTTEMPLEATE_HPP diff --git a/Exam/IKT203Exam/LibExample/TSingleLinkedListTemplate.hpp b/Exam/IKT203Exam/LibExample/TSingleLinkedListTemplate.hpp new file mode 100644 index 0000000..f985a6d --- /dev/null +++ b/Exam/IKT203Exam/LibExample/TSingleLinkedListTemplate.hpp @@ -0,0 +1,529 @@ +#ifndef TSINGLELINKEDLIST_HPP +#define TSINGLELINKEDLIST_HPP + +#pragma once + +#include // Required for the Clone function, and prevent delete on non-pointer types +#include "TDoublyLinkedListTemplate.hpp" +#include "TCircularDoublyLinkedListTemplate.hpp" + +template +class TDoublyLinkedList; // Forward declaration for friendship +template +class TCircularDoublyLinkedList; // Forward declaration for friendship + +// Callback type definitions +template +using FDataFactory = T(*)(TArgs); // <-- ADD THIS LINE + +template +using FCheckNode = bool(*)(const T, const T); + +template +using FVisitNode = void(*)(const T, int); + +template +class TNode { +private: + T data; // Data of type T (e.g., TSong*) + TNode* next; // Pointer to the next node + TNode* prev; // Pointer to the previous node, prepared for future use + + void SwapNextPrev(); // Swaps the next and prev pointers of this node +public: + // Constructor + + TNode(const T& aData); + + // Destructor + ~TNode(); + + // Getters + T GetData() const { return data; } + TNode* GetNext() const { return next; } + TNode* GetPrev() const { return prev; } + + // Setters + void SetNext(TNode* aNextNode) { next = aNextNode; } + void SetPrev(TNode* aPrevNode) { prev = aPrevNode; } + + // Add friendships here if needed + friend class TDoublyLinkedList; + friend class TCircularDoublyLinkedList; +}; + +// --- Method Implementations --- +// Constructor: Initializes the node with data from the factory function +template +TNode::TNode(const T& aData) : data(aData), next(nullptr), prev(nullptr) {} + +// Destructor: Deletes the data pointer +template +TNode::~TNode() { + //Do not delete data, data may exist outside the list + data = nullptr; // Set data to nullptr to avoid dangling pointer + next = nullptr; // Set next to nullptr to avoid dangling pointer + prev = nullptr; // Set prev to nullptr to avoid dangling pointer +} + +template +void TNode::SwapNextPrev() { + TNode* temp = next; + next = prev; + prev = temp; +} + +// --- End of TNode class --- + +// Singly Linked List TSingleLinkedList using TNode and dummy node +template +class TSingleLinkedList { +private: + // Helper to reset the list to empty state + void ResetList(); + +protected: + TNode* head; // Pointer to the dummy head node + TNode* tail; // Pointer to the tail node + int size; // Current size of the list + bool isDataOwner; // Indicates if the list owns the data + + // Internal implementations can be non-virtual + TNode* InternAppend(const T&); + TNode* InternPrepend(const T&); + + // Helper for RemoveAll to delete a node given its previous node + void InternalRemoveNode(TNode*, TNode*); + // Helper to get node at index (non-virtual, used internally) + TNode* GetNodeAtIndex(int aIndex) const; + +public: + // Constructor + TSingleLinkedList(bool); + // Virtual Destructor + virtual ~TSingleLinkedList(); + + // --- Core Operations (Virtual) --- + virtual void Append(const T&); + virtual void Prepend(const T&); + virtual T GetAtIndex(int); + virtual void Remove(const T&); + virtual void Reverse(); + virtual void RemoveAll(const T&); + virtual void ReverseSublist(int, int); + virtual TNode* GetMiddle() const; + virtual void Merge(TSingleLinkedList&); + + // --- Traversal functions that MUST now be virtual --- + virtual bool Contains(const T&) const; + virtual T Search(const T&, FCheckNode = nullptr) const; + virtual void ForEach(FVisitNode) const; + + // --- Non-Virtual Methods --- + template + T Append(FDataFactory, TArgs); + template + T Prepend(FDataFactory, TArgs); + int GetSize() const; + bool IsEmpty() const; + TSingleLinkedList Clone() const; + TNode* StealNodes(); +}; + +// Constructor: Initializes the dummy head node and list state +template +TSingleLinkedList::TSingleLinkedList(bool aIsDataOwner) + : head(new TNode(nullptr)), tail(head), size(0), isDataOwner(aIsDataOwner) { + // COMPILE-TIME SAFETY CHECK + // If the user tries to create a list of non-pointer types with ownership, + // stop compilation with a static_assert. + static_assert(std::is_pointer::value || !aIsDataOwner, + "isDataOwner can only be true if T is a pointer type (e.g., std::string*)."); +} + +// Virtual Destructor: Deletes all nodes and, if owner, the data +template +TSingleLinkedList::~TSingleLinkedList() { + TNode* current = head; + while (current != nullptr) { + TNode* nextNode = current->GetNext(); + if (isDataOwner && current->GetData() != nullptr) { + delete current->GetData(); // Delete data if the list owns it + } + delete current; // Free the node itself + current = nextNode; + } +} + +template +void TSingleLinkedList::InternalRemoveNode(TNode* aPrevNode, TNode* aNodeToDelete) { + if (aPrevNode == nullptr || aNodeToDelete == nullptr) return; + aPrevNode->SetNext(aNodeToDelete->GetNext()); + if (aNodeToDelete == this->tail) { + this->tail = aPrevNode; + } + if (this->isDataOwner) { + delete aNodeToDelete->GetData(); + } + delete aNodeToDelete; + this->size--; +} + + +// StealNodes: Detaches and returns the list's nodes, leaving it empty +// Uses ResetList to clear the list state +template +TNode* TSingleLinkedList::StealNodes() { + TNode* stolenHead = head->GetNext(); // First actual node + this->ResetList(); // Clear the list to empty state + return stolenHead; // Return the detached nodes +} + +// InternAppend: Handles the logic of adding a node to the end +template +TNode* TSingleLinkedList::InternAppend(const T& aData) { + TNode* newNode = new TNode(aData); + tail->SetNext(newNode); // Link the old tail to the new node + tail = newNode; // Update the tail pointer + size++; + return newNode; +} + +// Public Append method +template +void TSingleLinkedList::Append(const T& aData) { + InternAppend(aData); +} + +// InternPrepend: Handles the logic of adding a node to the beginning +template +TNode* TSingleLinkedList::InternPrepend(const T& aData) { + TNode* newNode = new TNode(aData); + newNode->SetNext(head->GetNext()); + head->SetNext(newNode); + if (tail == head) { // If the list was empty, new node is also the tail + tail = newNode; + } + size++; + return newNode; +} + +// Public Prepend method +template +void TSingleLinkedList::Prepend(const T& aData) { + InternPrepend(aData); +} + +// Append(): Creates a new node with the given factory and returns the new node's data. +template +template +T TSingleLinkedList::Append(FDataFactory aDataFactory, TArgs aArgs) { + if (aDataFactory == nullptr) { + return nullptr; // Return nullptr if no factory is provided + } + T newData = aDataFactory(aArgs); + this->Append(newData); // Call the existing virtual Append(T) method + return newData; +} + +// Prepend(): Creates a new node with the given factory and returns the new node's data. +template +template +T TSingleLinkedList::Prepend(FDataFactory aDataFactory, TArgs aArgs) { + if (aDataFactory == nullptr) { + return nullptr; // Return nullptr if no factory is provided + } + T newData = aDataFactory(aArgs); + this->Prepend(newData); // Call the existing virtual Prepend(T) method + return newData; +} + + +template +TNode* TSingleLinkedList::GetNodeAtIndex(int aIndex) const { + TNode* current = head->GetNext(); // Start at the first actual node + for (int i = 0; i < aIndex; ++i) { + current = current->GetNext(); + } + return current; +} + +// GetAtIndex: Returns the value at a specified index. +// This version iterates from the beginning only, as it cannot go backward. +template +T TSingleLinkedList::GetAtIndex(int aIndex) { + if (aIndex < 0 || aIndex >= size) { + return nullptr; // Index out of bounds + } + return GetNodeAtIndex(aIndex)->GetData(); +} + +// Remove: Removes the first node matching the given value. +// Requires tracking the previous node to relink the list. +template +void TSingleLinkedList::Remove(const T& aData) { + TNode* prev = head; + TNode* current = head->GetNext(); + + while (current != nullptr) { + if (current->GetData() == aData) { + // Match found, remove the node + InternalRemoveNode(prev, current); + return; // Only remove the first occurrence + } + } + prev = current; + current = current->GetNext(); +} + +// Reverse: Reverses the list using the classic iterative algorithm for singly-linked lists. +template +void TSingleLinkedList::Reverse() { + if (size <= 1) { + return; // Nothing to reverse + } + + // The original first node will become the new tail + tail = head->GetNext(); + + TNode* prevNode = nullptr; + TNode* currentNode = head->GetNext(); + TNode* nextNode = nullptr; + + while (currentNode != nullptr) { + nextNode = currentNode->GetNext(); // Store next node + currentNode->SetNext(prevNode); // Reverse the current node's pointer + prevNode = currentNode; // Move pointers one position ahead + currentNode = nextNode; + } + + // After the loop, prevNode is the new first node + head->SetNext(prevNode); +} + +// Contains: Checks if the list contains the given value, +// this is diffrent from Search as it only checks for existence +// This using search with a nullptr as the check function +template +bool TSingleLinkedList::Contains(const T& aData) const { + return Search(aData, nullptr) != nullptr; +} + +// Search: Finds a value using an optional custom comparison function +template +T TSingleLinkedList::Search(const T& aData, FCheckNode aCheckNode) const { + TNode* current = head->GetNext(); + while (current != nullptr) { + // Use the provided check function or default to direct comparison + if (aCheckNode != nullptr) { + if (aCheckNode(current->GetData(), aData)) { + return current->GetData(); + } + } + else { + if (current->GetData() == aData) { + return current->GetData(); + } + } + current = current->GetNext(); + } + return nullptr; // Not found +} + +// ForEach: Applies a function to each node in the list +template +void TSingleLinkedList::ForEach(FVisitNode aVisitNode) const { + if (aVisitNode == nullptr) { + return; + } + TNode* current = head->GetNext(); + int index = 0; + while (current != nullptr) { + aVisitNode(current->GetData(), index); + current = current->GetNext(); + index++; + } +} + +// GetSize: Returns the current number of elements in the list +template +int TSingleLinkedList::GetSize() const { + return size; +} + +// IsEmpty: Checks if the list has any elements +template +bool TSingleLinkedList::IsEmpty() const { + return size == 0; +} + +// RemoveAll: Removes all occurrences of a given value from the list. +template +void TSingleLinkedList::RemoveAll(const T& aData) { + TNode* prev = this->head; + TNode* current = this->head->GetNext(); + + while (current != nullptr) { + if (current->GetData() == aData) { + // Match found, remove the node + TNode* nodeToDelete = current; + current = current->GetNext(); // Advance current before deletion + InternalRemoveNode(prev, nodeToDelete); + // prev remains the same, as we just removed current + } + else { + // No match, advance both pointers + prev = current; + current = current->GetNext(); + } + } +} + +// Clone: Creates a deep copy of the list. +template +TSingleLinkedList TSingleLinkedList::Clone() const { + // Create a new list with the same ownership policy. + TSingleLinkedList newList(this->isDataOwner); + + TNode* current = this->head->GetNext(); + while (current != nullptr) { + T dataToCopy = current->GetData(); + + // This is the core of the deep copy logic. + if (this->isDataOwner && std::is_pointer::value && dataToCopy != nullptr) { + // If the list owns its pointer data, we must create a NEW object. + // This assumes the underlying type has a copy constructor. + // `std::remove_pointer_t` gets the type T points to (e.g., TSong from TSong*). + newList.Append(new std::remove_pointer_t(*dataToCopy)); + } + else { + // For value types (int, double) or non-owned pointers, just copy the value. + newList.Append(dataToCopy); + } + current = current->GetNext(); + } + return newList; +} + +// ReverseSublist: Reverses a portion of the list between two indices (inclusive). +template +void TSingleLinkedList::ReverseSublist(int aStart, int aEnd) { + // Validate indices + if (aStart < 0 || aEnd >= this->size || aStart >= aEnd) return; + + + // --- 1. Traverse to the nodes that define the sublist boundaries --- + // Use the helper to find the node *before* the sublist starts + TNode* startNodePrev = (aStart == 0) ? this->head : this->GetNodeAtIndex(aStart - 1); // Node before the start of the sublist + TNode* sublistHead = startNodePrev->GetNext(); // First node of the sublist + + // --- 2. Perform standard reversal on the sublist part only --- + TNode* prevNode = nullptr; + TNode* currentNode = sublistHead; + TNode* nextNode = nullptr; + for (int i = 0; i <= (aEnd - aStart); ++i) { + nextNode = currentNode->GetNext(); + currentNode->SetNext(prevNode); + prevNode = currentNode; + currentNode = nextNode; + } + + // --- 3. Stitch the reversed sublist back into the main list --- + // 'prevNode' is now the new head of the reversed sublist. + // 'sublistHead' is now the tail of the reversed sublist. + startNodePrev->SetNext(prevNode); + sublistHead->SetNext(currentNode); + + // Update the main tail pointer if the reversal included the original tail. + if (aEnd == this->size - 1) { + this->tail = sublistHead; + } +} + +// GetMiddle: Finds the middle node of the list using the fast/slow pointer algorithm. +template +TNode* TSingleLinkedList::GetMiddle() const { + if (this->IsEmpty()) { + return nullptr; + } + + TNode* slow = this->head->GetNext(); + TNode* fast = this->head->GetNext(); + + // The loop condition ensures 'fast' and 'fast->GetNext()' are valid. + // When 'fast' reaches the end, 'slow' will be at the midpoint. + while (fast != nullptr && fast->GetNext() != nullptr) { + slow = slow->GetNext(); + fast = fast->GetNext()->GetNext(); + } + + return slow; +} + +template +void TSingleLinkedList::ResetList() { + // Clear the list to an empty state + this->head->SetNext(nullptr); + this->tail = this->head; + this->size = 0; +} + +template +void TSingleLinkedList::Merge(TSingleLinkedList& aOtherList) { + // If the other list is empty, there's nothing to do. + if (aOtherList.IsEmpty()) { + return; + } + + // If this list is empty, take ownership of the other list's nodes. + if (this->IsEmpty()) { + this->head->SetNext(aOtherList.head->GetNext()); + this->tail = aOtherList.tail; + this->size = aOtherList.size; + + // Clear the other list + aOtherList.head->SetNext(nullptr); + aOtherList.tail = aOtherList.head; + aOtherList.size = 0; + return; + } + + // Pointers to the current nodes in each list + TNode* p1 = this->head->GetNext(); + TNode* p2 = aOtherList.head->GetNext(); + + // Use the dummy head of `this` list to start building the merged result. + TNode* tail = this->head; + + // --- Main Loop: Traverse both lists and pick the smaller node --- + while (p1 != nullptr && p2 != nullptr) { + if (p1->GetData() <= p2->GetData()) { + tail->SetNext(p1); + p1 = p1->GetNext(); + } + else { + tail->SetNext(p2); + p2 = p2->GetNext(); + } + tail = tail->GetNext(); + } + + // --- Append the Remainder --- + tail->SetNext(p1 != nullptr ? p1 : p2); + + // --- Update the Tail Pointer --- + while (tail->GetNext() != nullptr) { + tail = tail->GetNext(); + } + this->tail = tail; + + // --- Update Size --- + this->size += aOtherList.size; + + // --- Clear the Other List --- + aOtherList.ResetList(); +} + +// --- End of TSingleLinkedList class --- + +#endif // !TSINGLELINKEDLIST_HPP \ No newline at end of file diff --git a/Exam/IKT203Exam/LibExample/list.hpp b/Exam/IKT203Exam/LibExample/list.hpp new file mode 100644 index 0000000..ef61d9b --- /dev/null +++ b/Exam/IKT203Exam/LibExample/list.hpp @@ -0,0 +1,309 @@ +#pragma once +#include // For std::runtime_error +#include // For std::to_string + +// Linked List using TNode class with constructor and destructor +template +class TNode { +private: + T data; // Data of type T (e.g., TSong*) + TNode* next; // Pointer to the next node + TNode* prev; // Pointer to the previous node +public: + // Constructor + + TNode(T aData); + + // Destructor + ~TNode(); + + // Getters + T GetData() const { return data; } + TNode* GetNext() const { return next; } + TNode* GetPrev() const { return prev; } + + // Setters + void SetNext(TNode* aNextNode) { next = aNextNode; } + void SetPrev(TNode* aPrevNode) { prev = aPrevNode; } +}; + +// --- Method Implementations --- +// Constructor: Initializes the node with data from the factory function +template +TNode::TNode(T aData) : data(aData), next(nullptr), prev(nullptr) {} + +// Destructor: Deletes the data pointer +template +TNode::~TNode() { + //Do not delete data, data may exist outside the list + data = nullptr; // Set data to nullptr to avoid dangling pointer + next = nullptr; // Set next to nullptr to avoid dangling pointer + prev = nullptr; // Set prev to nullptr to avoid dangling pointer +} + +// --- End of TNode class --- + +// Type defined function for data factory +template +using FDataFactory = T(*)(TArgs); + +// Type defined functions for TLinkedList +template +using FCheckNode = bool(*)(const T, const T); + +template +using FVisitNode = void(*)(const T, int); + +// Linked List TLinkedList using TNode and dummy node +template +class TLinkedList { +private: + TNode* head; // Pointer to the dummy head node + TNode* tail; // Pointer to the tail node + int size; // Current size of the list + bool isDataOwner; // Indicates if the list owns the data and should delete it + + void InternAppend(T); + void InternPrepend(T); + +public: + // Constructor + TLinkedList(bool); + // Destructor + ~TLinkedList(); + + // Core Linked List Operations + template + T Append(FDataFactory, TArgs); + void Append(T); + + template + T Prepend(FDataFactory, TArgs); + void Prepend(T aValue); + + T GetAtIndex(int aIndex); + void Remove(const T aValue); + + // Finding and Checking Operations + bool Contains(const T aValue) const; + T Search(const T aValue, FCheckNode checkNode = nullptr) const; + + // Loop Operations + void ForEach(FVisitNode aVisitNode) const; + + // Helper Functions + int GetSize() const; + bool IsEmpty() const; + void Reverse(); +}; + +// --- Method Implementations --- +// Constructor: Initializes the dummy head node and tail +template +TLinkedList::TLinkedList(bool aIsDataOwner) : size(0) { + isDataOwner = aIsDataOwner; + head = new TNode(nullptr); // Create a dummy head node + tail = head; // Initially, tail is the same as head +} + +// Destructor: Deletes all nodes in the list +template +TLinkedList::~TLinkedList() { + TNode* current = head; + while (current != nullptr) { + TNode* nextNode = current->GetNext(); + if (isDataOwner && current->GetData() != nullptr) { + delete current->GetData(); // Delete the data if the list owns it + } + delete current; // Free the current node + current = nextNode; // Move to the next node + } +} + +template +void TLinkedList::InternAppend(T aData) { + TNode* newNode = new TNode(aData); + newNode->SetPrev(tail); // Set the prev pointer of the new node + tail->SetNext(newNode); // Update the next pointer of the current tail + tail = newNode; // Update the tail to the new node + size++; +} + +template +void TLinkedList::InternPrepend(T aData) { + TNode* newNode = new TNode(aData); + newNode->SetNext(head->GetNext()); + if (head->GetNext() != nullptr) { + head->GetNext()->SetPrev(newNode); // Update the prev pointer of the first node + } + head->SetNext(newNode); + newNode->SetPrev(head); // Set the prev pointer of the new node + if (tail == head) { + tail = newNode; + } + size++; +} + + +// Append(): Adds a new node with the given factory and returns the new node's data +template +template +T TLinkedList::Append(FDataFactory aDataFactory, TArgs aArgs) { + if(aDataFactory == nullptr) { + return nullptr; // Return nullptr if no factory is provided + } + T newData = aDataFactory(aArgs); + InternAppend(newData); + return newData; +} + +template +void TLinkedList::Append(T aValue) { + InternAppend(aValue); +} + +// Prepend(): Adds a new node with the given factory to the beginning of the list +template +template +T TLinkedList::Prepend(FDataFactory aDataFactory, TArgs aArgs) { + if (aDataFactory == nullptr) { + return nullptr; // Return nullptr if no factory is provided + } + T newData = aDataFactory(aArgs); + InternPrepend(newData); + return newData; +} + +template +void TLinkedList::Prepend(T aValue) { + InternPrepend(aValue); +} + +// GetAtIndex(): Returns the value at the specified index +template +T TLinkedList::GetAtIndex(int aIndex) { + if (aIndex < 0 || aIndex >= size) { + return nullptr; // Return nullptr if index is out of bounds + } + TNode* current; + if (aIndex < size / 2) { + current = head->GetNext(); + for (int i = 0; i < aIndex; i++) { + current = current->GetNext(); + } + } + else { + current = tail; + for (int i = size - 1; i > aIndex; i--) { + current = current->GetPrev(); + } + } + return current->GetData(); // Return the data directly +} + +// Remove(): Removes the first node with the given value +template +void TLinkedList::Remove(const T aValue) { + TNode* current = head->GetNext(); + while (current != nullptr) { + if (current->GetData() == aValue) { + TNode* nodeToDelete = current; + if (current->GetPrev() != nullptr) { + current->GetPrev()->SetNext(current->GetNext()); + } + if (current->GetNext() != nullptr) { + current->GetNext()->SetPrev(current->GetPrev()); + } + if (nodeToDelete == tail) { + tail = current->GetPrev(); + } + + if (isDataOwner && nodeToDelete->GetData() != nullptr) { + delete nodeToDelete->GetData(); // Delete the data if the list owns it + } + delete nodeToDelete; + size--; + return; + } + current = current->GetNext(); + } +} + +// Contains(): Checks if the list contains the given value +template +bool TLinkedList::Contains(const T aValue) const { + TNode* current = head->GetNext(); + while (current != nullptr) { + if (current->GetData() == aValue) { + return true; + } + current = current->GetNext(); + } + return false; +} + +// Search(): Searches for a node with the given value using an optional check function +template +T TLinkedList::Search(const T aValue, FCheckNode checkNode) const { + TNode* current = head->GetNext(); + while (current != nullptr) { + if (checkNode == nullptr) { + if (current->GetData() == aValue) { + return current->GetData(); + } + } else { + if (checkNode(current->GetData(), aValue)) { + return current->GetData(); + } + } + current = current->GetNext(); + } + return nullptr; +} + +// ForEach(): Applies a function to each node in the list +template +void TLinkedList::ForEach(FVisitNode aVisitNode) const { + if (aVisitNode == nullptr) { + return; // Return if no visit function is provided + } + TNode* current = head->GetNext(); + int index = 0; + while (current != nullptr) { + aVisitNode(static_cast(current->GetData()), index); // Cast to const T + current = current->GetNext(); + index++; + } +} + +// Reverse(): Reverses the order of the nodes in the list +template +void TLinkedList::Reverse() { + TNode* current = head->GetNext(); + TNode* temp = nullptr; // Temporary pointer for swapping + + // Handle an empty or single-node list + if (current == nullptr || current->GetNext() == nullptr) { + return; + } + + // Iterate and swap next and prev pointers + while (current != nullptr) { + temp = current->GetPrev(); // Store prev pointer + current->SetPrev(current->GetNext()); // Set prev to next + current->SetNext(temp); // Set next to temp (which holds original prev) + current = current->GetPrev(); // Move to the original next node + } + + // Update head and tail + TNode* newHeadNext = tail; // The original tail becomes the new head->next + tail = head->GetNext(); // The original first node is now the tail + tail->SetNext(nullptr); // Ensure the new tail has no next pointer + head->SetNext(newHeadNext); // Set the head's next to the new first node +} + +template +int TLinkedList::GetSize() const { + return size; +} +// --- End of TLinkedList class --- \ No newline at end of file diff --git a/Exam/IKT203Exam/LibExample/queue.hpp b/Exam/IKT203Exam/LibExample/queue.hpp new file mode 100644 index 0000000..16b76fa --- /dev/null +++ b/Exam/IKT203Exam/LibExample/queue.hpp @@ -0,0 +1,73 @@ +#pragma once +#include // For std::runtime_error + +template +class TQueue { + private: + T data[MAX_SIZE]; // A static array of T with MAX_SIZE elements + int frontIndex; // The index of the front element + int rearIndex; // The index of the rear element + int count; // Current number of elements in the queue + public: + // Constructor + TQueue(); + // No destructor is needed since we aren't using 'new' + // --- Core Queue Operations --- + void Enqueue(const T& aElement); + T Dequeue(); + T GetFront() const; + // --- Helper Functions --- + int size() const; + bool IsEmpty() const; + bool IsFull() const; +}; +// --- Method Implementations --- +// Constructor: Initializes the front and rear indices +template +TQueue::TQueue() : frontIndex(0), rearIndex(-1), count(0) { + // No memory allocation is needed +} +// enqueue(): Adds an element to the rear of the queue +template +void TQueue::Enqueue(const T& aElement) { + if (IsFull()) { + throw std::runtime_error("Queue overflow: cannot enqueue to a full queue."); + } + rearIndex = (rearIndex + 1) % MAX_SIZE; // Circular increment + data[rearIndex] = aElement; + count++; +} +// dequeue(): Removes and returns the front element +template +T TQueue::Dequeue() { + if (IsEmpty()) { + throw std::runtime_error("Queue underflow: cannot dequeue from an empty queue."); + } + T frontElement = data[frontIndex]; + frontIndex = (frontIndex + 1) % MAX_SIZE; // Circular increment + count--; + return frontElement; +} +// getFront(): Returns the front element without removing it +template +T TQueue::GetFront() const { + if (IsEmpty()) { + throw std::runtime_error("Queue is empty: cannot get front."); + } + return data[frontIndex]; +} +// size(): Returns the current number of elements +template +int TQueue::size() const { + return count; +} +// isEmpty(): Checks if the queue is empty +template +bool TQueue::IsEmpty() const { + return count == 0; +} +// isFull(): Checks if the queue is full +template +bool TQueue::IsFull() const { + return count == MAX_SIZE; +} \ No newline at end of file diff --git a/Exam/IKT203Exam/LibExample/stack.hpp b/Exam/IKT203Exam/LibExample/stack.hpp new file mode 100644 index 0000000..d88f08d --- /dev/null +++ b/Exam/IKT203Exam/LibExample/stack.hpp @@ -0,0 +1,79 @@ +#pragma once +#include // For std::runtime_error + +// The template now takes a type 'T' and an integer 'MAX_SIZE' +template +class TStack { +private: + T data[MAX_SIZE]; // A static array of T with MAX_SIZE elements + int topIndex; // The index of the top element (-1 if empty) + +public: + // Constructor + TStack(); + + // No destructor is needed since we aren't using 'new' + + // --- Core Stack Operations --- + void Push(const T& aElement); + T Pop(); + T Peek() const; + + // --- Helper Functions --- + int GetSize() const; + bool IsEmpty() const; + bool IsFull() const; +}; + +// --- Method Implementations --- + +// Constructor: Just initializes the top index +template +TStack::TStack() : topIndex(-1) { + // No memory allocation is needed +} + +// push(): Adds an element to the top +template +void TStack::Push(const T& aElement) { + if (IsFull()) { + throw std::runtime_error("Stack overflow: cannot push to a full stack."); + } + data[++topIndex] = aElement; +} + +// pop(): Removes and returns the top element +template +T TStack::Pop() { + if (IsEmpty()) { + throw std::runtime_error("Stack underflow: cannot pop from an empty stack."); + } + return data[topIndex--]; +} + +// peek(): Returns the top element without removing it +template +T TStack::Peek() const { + if (IsEmpty()) { + throw std::runtime_error("Stack is empty: cannot peek."); + } + return data[topIndex]; +} + +// size(): Returns the current number of elements +template +int TStack::GetSize() const { + return topIndex + 1; +} + +// isEmpty(): Checks if the stack is empty +template +bool TStack::IsEmpty() const { + return topIndex == -1; +} + +// isFull(): Checks if the stack is full +template +bool TStack::IsFull() const { + return topIndex == MAX_SIZE - 1; +} \ No newline at end of file diff --git a/Exam/IKT203Exam/Portfolio/Assignment-01/CMakeLists.txt b/Exam/IKT203Exam/Portfolio/Assignment-01/CMakeLists.txt new file mode 100644 index 0000000..99a3a7e --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/Assignment-01/CMakeLists.txt @@ -0,0 +1,40 @@ +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + + + +# "ON" = build Option 1, "OFF" = build Option 2. +option(BUILD_ASSIGNMENT_01_OPTION_1 "Build Assignment Option 1 (Standard)" ON) + +add_executable(Assignment-01 + main.cpp +) + +# Conditionally add the correct source file +if(BUILD_ASSIGNMENT_01_OPTION_1) + # If ON, add option1.cpp and define 'ASSIGNMENT_OPTION=1' for C++ + target_sources(Assignment-01 + PRIVATE + option1.cpp + option1.h + ) + target_compile_definitions(Assignment-01 PRIVATE "ASSIGNMENT_01_OPTION=1") +else() + # If OFF, add option2.cpp and define 'ASSIGNMENT_OPTION=2' for C++ + target_sources(Assignment-01 + PRIVATE + option2.cpp + option2.h + ) + target_compile_definitions(Assignment-01 PRIVATE "ASSIGNMENT_01_OPTION=2") +endif() +target_link_libraries(Assignment-01 + PRIVATE + SharedLib +) + + +add_custom_command(TARGET Assignment-01 POST_BUILD + # Add a custom command here if needed + COMMAND ${CMAKE_COMMAND} -E echo "Assignment-01 post-build step" +) \ No newline at end of file diff --git a/Exam/IKT203Exam/Portfolio/Assignment-01/main.cpp b/Exam/IKT203Exam/Portfolio/Assignment-01/main.cpp new file mode 100644 index 0000000..02423d9 --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/Assignment-01/main.cpp @@ -0,0 +1,60 @@ +// Mandatory-02.cpp : Defines the entry point for the application. +// + +/* +Dear Student, + +Remember to follow the coding standards and best practices discussed +in the portfolio assignment document. +Good luck with your portfolio! + +NB: Do not delete the code below that prints the assignment and option info! + +--------------------------------------------------------------------- +*** HOW TO SWITCH BETWEEN OPTION 1 AND OPTION 2 *** +--------------------------------------------------------------------- +You CANNOT switch options by changing this file. + +1. Go to the 'CMakeLists.txt' file for this assignment. +2. Find the line: + option(BUILD_ASSIGNMENT_OPTION_1 "..." ON) +3. Change 'ON' (for Option 1) to 'OFF' (for Option 2). + +*** VERY IMPORTANT: After changing the option *** +Your project will NOT update until you re-run the CMake configuration. + +To force an update (e.g., in Visual Studio): +- Right-click the 'CMakeLists.txt' file and select 'Configure Cache'. +- OR, simply delete the 'out' / 'build' folder and rebuild the project. +--------------------------------------------------------------------- +*/ + +#include +#include + +static constexpr std::string_view AssignmentName = "Category 1: Lists, Stacks, & Queues"; + + +#if ASSIGNMENT_01_OPTION == 1 +#include "option1.h" +static constexpr std::string_view AssignmentOption = "Option 1 (Standard): Console Text Editor."; +#elif ASSIGNMENT_01_OPTION == 2 +#include "option2.h" +static constexpr std::string_view AssignmentOption = "Option 2 (Advanced): Console Music Player."; +#endif + + + +int main(int argc, char* argv[]) +{ + int appStatus = 0; + std::cout << AssignmentName << std::endl; + std::cout << AssignmentOption << std::endl; + + // Create only core or common code in main.cpp + // Use the option header files to implement the specific assignment option logic + appStatus = RunApp(); + return appStatus; +} + + diff --git a/Exam/IKT203Exam/Portfolio/Assignment-01/option1.cpp b/Exam/IKT203Exam/Portfolio/Assignment-01/option1.cpp new file mode 100644 index 0000000..9761d29 --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/Assignment-01/option1.cpp @@ -0,0 +1,109 @@ +// Option 1 (Standard): Console Text Editor. +// + +#include "option1.h" +#include +#include "TDoublyLinkedList.h" +#include "TQueue.h" +#include "TStack.h" +#include "Utils.h" + +TDoublyLinkedList document; +TQueue printQueue; +TStack undoStack, redoStack; + +bool running = true; +int lastIndex = 0; +std::string deletedLine; + +void Undo() +{ + if (!undoStack.IsEmpty()) { + const auto action = undoStack.Pop(); + if (action.action == INSERT){ + document.Remove(action.index); + } + else{ + document.InsertAtIndex(action.index, action.text); + } + redoStack.Push(action); + } +} +void Redo() +{ + if (!redoStack.IsEmpty()) { + const auto action = redoStack.Pop(); + if (action.action == INSERT) { + document.InsertAtIndex(action.index, action.text); + } + else { + document.Remove(action.index); + } + undoStack.Push(action); + } +} + + +int RunApp() +{ + // Implement the Console Text Editor application logic here + while (running) { + switch (Utils::Choice()) { + case 1: { + std::cout << "----------Add line----------" << std::endl; + lastIndex = Utils::Insert(document, undoStack, redoStack, lastIndex); + break; + } + case 2: { + std::cout << "----------Remove line----------" << std::endl; + Utils::PrintList(document); + lastIndex = Utils::RemoveLine(document, undoStack, redoStack, lastIndex); + break; + } + case 3: { + std::cout << "----------Current document----------" << std::endl; + for (int i = 0; i < document.GetSize(); i++) + std::cout << i + 1 << ". " << document.GetAtIndex(i) << std::endl; + std::cout << "------------------------------------\n\n"; + break; + } + case 4: { + for (int i = 0; i < document.GetSize(); ++i) + printQueue.Enqueue(document.GetAtIndex(i)); + + std::cout << "----------Printing queue-----------" << std::endl; + + while (!printQueue.IsEmpty()) + std::cout << printQueue.Dequeue() << std::endl; + std::cout << "------------------------------------\n\n"; + + break; + } + + case 5: { + std::cout << "----------UNDO----------" < +#include "option2.h" + +static bool SongReadCallback(const int aIndex, const int aTotalCount, const std::string& aArtist, const std::string& aTitle, const std::string& aYear, const std::string& aGenre, const std::string& aSource) { + // Implement the logic to process each song read from the file + // For example, print the song details to the console + std::cout << "Song " << (aIndex + 1) << " of " << aTotalCount << ":\n"; + std::cout << " Artist: " << aArtist << "\n"; + std::cout << " Title: " << aTitle << "\n"; + std::cout << " Year: " << aYear << "\n"; + std::cout << " Genre: " << aGenre << "\n"; + std::cout << " Source: " << aSource << "\n\n"; + // Return true to continue reading more songs + return true; +} + + diff --git a/Exam/IKT203Exam/Portfolio/Assignment-01/option2.h b/Exam/IKT203Exam/Portfolio/Assignment-01/option2.h new file mode 100644 index 0000000..754f3df --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/Assignment-01/option2.h @@ -0,0 +1,10 @@ +// option1.h : Option 2 (Advanced): Console Music Player. +#pragma once + +#ifndef OPTION2_H +#define OPTION2_H + +int RunApp(); + + +#endif // OPTION2_H diff --git a/Exam/IKT203Exam/Portfolio/Assignment-02/CMakeLists.txt b/Exam/IKT203Exam/Portfolio/Assignment-02/CMakeLists.txt new file mode 100644 index 0000000..a8e906b --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/Assignment-02/CMakeLists.txt @@ -0,0 +1,40 @@ +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + + + +# "ON" = build Option 1, "OFF" = build Option 2. +option(BUILD_ASSIGNMENT_02_OPTION_1 "Build Assignment Option 1 (Standard)" ON) + +add_executable(Assignment-02 + main.cpp +) + +# Conditionally add the correct source file +if(BUILD_ASSIGNMENT_02_OPTION_1) + # If ON, add option1.cpp and define 'ASSIGNMENT_OPTION=1' for C++ + target_sources(Assignment-02 + PRIVATE + option1.cpp + option1.h + ) + target_compile_definitions(Assignment-02 PRIVATE "ASSIGNMENT_02_OPTION=1") +else() + # If OFF, add option2.cpp and define 'ASSIGNMENT_OPTION=2' for C++ + target_sources(Assignment-02 + PRIVATE + option2.cpp + option2.h + ) + target_compile_definitions(Assignment-02 PRIVATE "ASSIGNMENT_02_OPTION=2") +endif() +target_link_libraries(Assignment-02 + PRIVATE + SharedLib +) + + +add_custom_command(TARGET Assignment-02 POST_BUILD + # Add a custom command here if needed + COMMAND ${CMAKE_COMMAND} -E echo "Assignment-02 post-build step" +) diff --git a/Exam/IKT203Exam/Portfolio/Assignment-02/main.cpp b/Exam/IKT203Exam/Portfolio/Assignment-02/main.cpp new file mode 100644 index 0000000..f2228b8 --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/Assignment-02/main.cpp @@ -0,0 +1,57 @@ +// Mandatory-02.cpp : Defines the entry point for the application. +// + +/* +Dear Student, + +Remember to follow the coding standards and best practices discussed +in the portfolio assignment document. +Good luck with your portfolio! + +NB: Do not delete the code below that prints the assignment and option info! + +--------------------------------------------------------------------- +*** HOW TO SWITCH BETWEEN OPTION 1 AND OPTION 2 *** +--------------------------------------------------------------------- +You CANNOT switch options by changing this file. + +1. Go to the 'CMakeLists.txt' file for this assignment. +2. Find the line: + option(BUILD_ASSIGNMENT_OPTION_1 "..." ON) +3. Change 'ON' (for Option 1) to 'OFF' (for Option 2). + +*** VERY IMPORTANT: After changing the option *** +Your project will NOT update until you re-run the CMake configuration. + +To force an update (e.g., in Visual Studio): +- Right-click the 'CMakeLists.txt' file and select 'Configure Cache'. +- OR, simply delete the 'out' / 'build' folder and rebuild the project. +--------------------------------------------------------------------- +*/ + +#include +#include + +static constexpr std::string_view AssignmentName = "Category 2: Sorting & Searching"; + +#if ASSIGNMENT_02_OPTION == 1 +#include "option1.h" +static constexpr std::string_view AssignmentOption = "Option 1 (Standard): Cruise Ship Manifest."; +#elif ASSIGNMENT_02_OPTION == 2 +#include "option2.h" +static constexpr std::string_view AssignmentOption = "Option 2 (Advanced): Combined Corporate Directory."; +#endif + + + +int main(int argc, char* argv[]) +{ + int appStatus = 0; + std::cout << AssignmentName << std::endl; + std::cout << AssignmentOption << std::endl; + + // Create only core or common code in main.cpp + // Use the option header files to implement the specific assignment option logic + appStatus = RunApp(); + return appStatus; +} diff --git a/Exam/IKT203Exam/Portfolio/Assignment-02/option1.cpp b/Exam/IKT203Exam/Portfolio/Assignment-02/option1.cpp new file mode 100644 index 0000000..aa8a3fa --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/Assignment-02/option1.cpp @@ -0,0 +1,36 @@ +// Option 1 (Standard): Console Text Editor. +// + +#include +#include +#include "option1.h" +#include "SharedLib.h" + +/** + * @brief Callback function to process one name. + */ +static bool NameReadCallback(const int aIndex, const int aTotalCount, const std::string& aFirstName, const std::string& aLastName) +{ + std::cout << "Reading Name " << (aIndex + 1) << " of " << aTotalCount << ": " + << aFirstName << " " << aLastName << "\n"; + + // We only want to read 10 names (index 0 through 9) + // Return false when aIndex is 9 to stop the loop after this one. + return (aIndex < 9); +} + + +int RunApp() +{ + // Path to the names data file + std::string filename = "F:\\IKT203\\VisualStudio\\DATA\\random_names.txt"; + + std::cout << "Reading first 10 names from file: " << filename << "\n\n"; + + // Call the utility function with the name callback + readNamesFromFile(filename, NameReadCallback); + + std::cout << "\nFinished reading names." << std::endl; + + return 0; +} \ No newline at end of file diff --git a/Exam/IKT203Exam/Portfolio/Assignment-02/option1.h b/Exam/IKT203Exam/Portfolio/Assignment-02/option1.h new file mode 100644 index 0000000..f0b36c3 --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/Assignment-02/option1.h @@ -0,0 +1,11 @@ +// option1.h : Option 1 (Standard): Console Text Editor. + +#pragma once + +#ifndef OPTION1_H +#define OPTION1_H + +int RunApp(); + + +#endif // OPTION1_H diff --git a/Exam/IKT203Exam/Portfolio/Assignment-02/option2.cpp b/Exam/IKT203Exam/Portfolio/Assignment-02/option2.cpp new file mode 100644 index 0000000..3c7fc79 --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/Assignment-02/option2.cpp @@ -0,0 +1,8 @@ +// Option 2 (Advanced): Console Music Player. + +#include "option2.h" + +int RunApp() { + // Implement the Console Music Player application logic here + return 0; +} \ No newline at end of file diff --git a/Exam/IKT203Exam/Portfolio/Assignment-02/option2.h b/Exam/IKT203Exam/Portfolio/Assignment-02/option2.h new file mode 100644 index 0000000..754f3df --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/Assignment-02/option2.h @@ -0,0 +1,10 @@ +// option1.h : Option 2 (Advanced): Console Music Player. +#pragma once + +#ifndef OPTION2_H +#define OPTION2_H + +int RunApp(); + + +#endif // OPTION2_H diff --git a/Exam/IKT203Exam/Portfolio/Assignment-03/CMakeLists.txt b/Exam/IKT203Exam/Portfolio/Assignment-03/CMakeLists.txt new file mode 100644 index 0000000..cc98135 --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/Assignment-03/CMakeLists.txt @@ -0,0 +1,39 @@ +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + + +# "ON" = build Option 1, "OFF" = build Option 2. +option(BUILD_ASSIGNMENT_03_OPTION_1 "Build Assignment Option 1 (Standard)" ON) + +add_executable(Assignment-03 + main.cpp +) + +# Conditionally add the correct source file +if(BUILD_ASSIGNMENT_03_OPTION_1) + # If ON, add option1.cpp and define 'ASSIGNMENT_OPTION=1' for C++ + target_sources(Assignment-03 + PRIVATE + option1.cpp + option1.h + ) + target_compile_definitions(Assignment-03 PRIVATE "ASSIGNMENT_03_OPTION=1") +else() + # If OFF, add option2.cpp and define 'ASSIGNMENT_OPTION=2' for C++ + target_sources(Assignment-03 + PRIVATE + option2.cpp + option2.h + ) + target_compile_definitions(Assignment-03 PRIVATE "ASSIGNMENT_03_OPTION=2") +endif() +target_link_libraries(Assignment-03 + PRIVATE + SharedLib +) + + +add_custom_command(TARGET Assignment-03 POST_BUILD + # Add a custom command here if needed + COMMAND ${CMAKE_COMMAND} -E echo "Assignment-03 post-build step" +) diff --git a/Exam/IKT203Exam/Portfolio/Assignment-03/main.cpp b/Exam/IKT203Exam/Portfolio/Assignment-03/main.cpp new file mode 100644 index 0000000..078088e --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/Assignment-03/main.cpp @@ -0,0 +1,54 @@ +/* +Dear Student, + +Remember to follow the coding standards and best practices discussed +in the portfolio assignment document. +Good luck with your portfolio! + +NB: Do not delete the code below that prints the assignment and option info! + +--------------------------------------------------------------------- +*** HOW TO SWITCH BETWEEN OPTION 1 AND OPTION 2 *** +--------------------------------------------------------------------- +You CANNOT switch options by changing this file. + +1. Go to the 'CMakeLists.txt' file for this assignment. +2. Find the line: + option(BUILD_ASSIGNMENT_OPTION_1 "..." ON) +3. Change 'ON' (for Option 1) to 'OFF' (for Option 2). + +*** VERY IMPORTANT: After changing the option *** +Your project will NOT update until you re-run the CMake configuration. + +To force an update (e.g., in Visual Studio): +- Right-click the 'CMakeLists.txt' file and select 'Configure Cache'. +- OR, simply delete the 'out' / 'build' folder and rebuild the project. +--------------------------------------------------------------------- +*/ + +#include +#include + +static constexpr std::string_view AssignmentName = "Category 3: Trees (BST, AVL & RBT)"; + +#if ASSIGNMENT_03_OPTION == 1 +#include "option1.h" +static constexpr std::string_view AssignmentOption = "Option 1 (Standard): Employee Directory (BST vs. AVL)."; +#elif ASSIGNMENT_03_OPTION == 2 +#include "option2.h" +static constexpr std::string_view AssignmentOption = "Option 2 (Advanced): Interpreted Calculator."; +#endif + + + +int main(int argc, char* argv[]) +{ + int appStatus = 0; + std::cout << AssignmentName << std::endl; + std::cout << AssignmentOption << std::endl; + + // Create only core or common code in main.cpp + // Use the option header files to implement the specific assignment option logic + appStatus = RunApp(); + return appStatus; +} diff --git a/Exam/IKT203Exam/Portfolio/Assignment-03/option1.cpp b/Exam/IKT203Exam/Portfolio/Assignment-03/option1.cpp new file mode 100644 index 0000000..74ef99d --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/Assignment-03/option1.cpp @@ -0,0 +1,6 @@ +#include "option1.h" + +int RunApp() { + // Implement the Console Text Editor application logic here + return 0; +} \ No newline at end of file diff --git a/Exam/IKT203Exam/Portfolio/Assignment-03/option1.h b/Exam/IKT203Exam/Portfolio/Assignment-03/option1.h new file mode 100644 index 0000000..658aeb1 --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/Assignment-03/option1.h @@ -0,0 +1,9 @@ +#pragma once + +#ifndef OPTION1_H +#define OPTION1_H + +int RunApp(); + + +#endif // OPTION1_H diff --git a/Exam/IKT203Exam/Portfolio/Assignment-03/option2.cpp b/Exam/IKT203Exam/Portfolio/Assignment-03/option2.cpp new file mode 100644 index 0000000..ead6154 --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/Assignment-03/option2.cpp @@ -0,0 +1,6 @@ +#include "option2.h" + +int RunApp() { + // Implement the Console Music Player application logic here + return 0; +} \ No newline at end of file diff --git a/Exam/IKT203Exam/Portfolio/Assignment-03/option2.h b/Exam/IKT203Exam/Portfolio/Assignment-03/option2.h new file mode 100644 index 0000000..7813abf --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/Assignment-03/option2.h @@ -0,0 +1,9 @@ +#pragma once + +#ifndef OPTION2_H +#define OPTION2_H + +int RunApp(); + + +#endif // OPTION2_H diff --git a/Exam/IKT203Exam/Portfolio/Assignment-04/CMakeLists.txt b/Exam/IKT203Exam/Portfolio/Assignment-04/CMakeLists.txt new file mode 100644 index 0000000..578df4e --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/Assignment-04/CMakeLists.txt @@ -0,0 +1,37 @@ +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + + +# "ON" = build Option 1, "OFF" = build Option 2. +option(BUILD_ASSIGNMENT_04_OPTION_1 "Build Assignment Option 1 (Standard)" OFF) + +add_executable(Assignment-04 + main.cpp +) + +if(BUILD_ASSIGNMENT_04_OPTION_1) + target_sources(Assignment-04 + PRIVATE + option1.cpp + option1.h + ) + target_compile_definitions(Assignment-04 PRIVATE "ASSIGNMENT_04_OPTION=1") +else() + target_sources(Assignment-04 + PRIVATE + option2.cpp + option2.h + ) + target_compile_definitions(Assignment-04 PRIVATE "ASSIGNMENT_04_OPTION=2") +endif() + +target_link_libraries(Assignment-04 + PRIVATE + SharedLib +) + + +add_custom_command(TARGET Assignment-04 POST_BUILD + # Add a custom command here if needed + COMMAND ${CMAKE_COMMAND} -E echo "Assignment-04 post-build step" +) diff --git a/Exam/IKT203Exam/Portfolio/Assignment-04/main.cpp b/Exam/IKT203Exam/Portfolio/Assignment-04/main.cpp new file mode 100644 index 0000000..ae431f3 --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/Assignment-04/main.cpp @@ -0,0 +1,53 @@ +/* +Dear Student, + +Remember to follow the coding standards and best practices discussed +in the portfolio assignment document. +Good luck with your portfolio! + +NB: Do not delete the code below that prints the assignment and option info! + +--------------------------------------------------------------------- +*** HOW TO SWITCH BETWEEN OPTION 1 AND OPTION 2 *** +--------------------------------------------------------------------- +You CANNOT switch options by changing this file. + +1. Go to the 'CMakeLists.txt' file for this assignment. +2. Find the line: + option(BUILD_ASSIGNMENT_OPTION_1 "..." ON) +3. Change 'ON' (for Option 1) to 'OFF' (for Option 2). + +*** VERY IMPORTANT: After changing the option *** +Your project will NOT update until you re-run the CMake configuration. + +To force an update (e.g., in Visual Studio): +- Right-click the 'CMakeLists.txt' file and select 'Configure Cache'. +- OR, simply delete the 'out' / 'build' folder and rebuild the project. +--------------------------------------------------------------------- +*/ + +#include +#include +static constexpr std::string_view AssignmentName = "Category 4: Graphs & Dijkstra's Algorithm"; + +#if ASSIGNMENT_04_OPTION == 1 +static constexpr std::string_view AssignmentOption = "Option 1 (Standard): Data Center Network Monitor."; +#include "option1.h" +#elif ASSIGNMENT_04_OPTION == 2 +static constexpr std::string_view AssignmentOption = "Option 2 (Advanced): Inter-city Logistics Router."; +#include "option2.h" +#endif + + +int main(int argc, char* argv[]) +{ + int appStatus = 0; + std::cout << AssignmentName << std::endl; + std::cout << AssignmentOption << std::endl; + + + // Create only core or common code in main.cpp + // Use the option header files to implement the specific assignment option logic + appStatus = RunApp(); + return appStatus; +} diff --git a/Exam/IKT203Exam/Portfolio/Assignment-04/option1.cpp b/Exam/IKT203Exam/Portfolio/Assignment-04/option1.cpp new file mode 100644 index 0000000..37f5e0d --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/Assignment-04/option1.cpp @@ -0,0 +1,6 @@ +#include "option1.h" +#include + +int RunApp() { + return 0; +} \ No newline at end of file diff --git a/Exam/IKT203Exam/Portfolio/Assignment-04/option1.h b/Exam/IKT203Exam/Portfolio/Assignment-04/option1.h new file mode 100644 index 0000000..658aeb1 --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/Assignment-04/option1.h @@ -0,0 +1,9 @@ +#pragma once + +#ifndef OPTION1_H +#define OPTION1_H + +int RunApp(); + + +#endif // OPTION1_H diff --git a/Exam/IKT203Exam/Portfolio/Assignment-04/option2.cpp b/Exam/IKT203Exam/Portfolio/Assignment-04/option2.cpp new file mode 100644 index 0000000..48aeef6 --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/Assignment-04/option2.cpp @@ -0,0 +1,47 @@ +#include +#include "option1.h" +#include "SharedLib.h" +static constexpr std::string_view AssignmentOption = "Option 1 (Standard): Data Center Network Monitor."; + + +/** + * @brief Callback function to process one node. + */ +static bool NodeReadCallback(const int aIndex, const int aTotalCount, const std::string& aNode) +{ + std::cout << "Loading Node " << (aIndex + 1) << " of " << aTotalCount << ": " << aNode << "\n"; + + // Return true to continue reading + return true; +} + +/** + * @brief Callback function to process one edge. + */ +static bool EdgeReadCallback(const int aIndex, const int aTotalCount, const std::string& aFromNode, const std::string& aToNode, float aWeight) +{ + std::cout << " Loading Edge " << (aIndex + 1) << " of " << aTotalCount << ": " + << aFromNode << " -> " << aToNode << " (Weight: " << aWeight << ")\n"; + + // Return true to continue reading + return true; +} + + +int RunApp() +{ + + std::cout << AssignmentOption << std::endl; + + // Path to the graph data file + std::string filename = "F:\\IKT203\\VisualStudio\\DATA\\city_graph.txt"; + + std::cout << "Reading graph from file: " << filename << "\n\n"; + + // Call the utility function with both callbacks + readGraphFromFile(filename, NodeReadCallback, EdgeReadCallback); + + std::cout << "\nFinished reading graph." << std::endl; + + return 0; +} \ No newline at end of file diff --git a/Exam/IKT203Exam/Portfolio/Assignment-04/option2.h b/Exam/IKT203Exam/Portfolio/Assignment-04/option2.h new file mode 100644 index 0000000..7813abf --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/Assignment-04/option2.h @@ -0,0 +1,9 @@ +#pragma once + +#ifndef OPTION2_H +#define OPTION2_H + +int RunApp(); + + +#endif // OPTION2_H diff --git a/Exam/IKT203Exam/Portfolio/CMakeLists.txt b/Exam/IKT203Exam/Portfolio/CMakeLists.txt new file mode 100644 index 0000000..c8b96cf --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/CMakeLists.txt @@ -0,0 +1,20 @@ +# CMakeList.txt : Top-level CMake project file, do global configuration +# and include sub-projects here. +# +cmake_minimum_required (VERSION 3.20) +project ("Portfolio") + +# Enable Hot Reload for MSVC compilers if supported. +if (POLICY CMP0141) + cmake_policy(SET CMP0141 NEW) + set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$,$>,$<$:EditAndContinue>,$<$:ProgramDatabase>>") +endif() + +# Include sub-projects. +add_subdirectory(SharedLib) +# Tell CMake to find and include the first exercise project. +add_subdirectory(Assignment-01) +add_subdirectory(Assignment-02) +add_subdirectory(Assignment-03) +add_subdirectory(Assignment-04) + diff --git a/Exam/IKT203Exam/Portfolio/IKT203_ Final Portfolio Assignment.pdf b/Exam/IKT203Exam/Portfolio/IKT203_ Final Portfolio Assignment.pdf new file mode 100644 index 0000000..43c9640 Binary files /dev/null and b/Exam/IKT203Exam/Portfolio/IKT203_ Final Portfolio Assignment.pdf differ diff --git a/Exam/IKT203Exam/Portfolio/SharedLib/CMakeLists.txt b/Exam/IKT203Exam/Portfolio/SharedLib/CMakeLists.txt new file mode 100644 index 0000000..4530390 --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/SharedLib/CMakeLists.txt @@ -0,0 +1,39 @@ +# --- Step 1: Create the Library --- + +# Define a library target named "SharedLib". +# We use STATIC because we are using cpp and header files. +add_library(SharedLib STATIC) + +# --- Step 2: Add Header Files to the Library --- + +# This command explicitly lists the header files that belong to the library. +# This helps Visual Studio display them nicely in the Solution Explorer. +target_sources(SharedLib + PUBLIC + # You can add more functionalty to SharedLib.h just by adding more definitions in SharedLib.h. + SharedLib.h + TDoublyLinkedList.h + TStack.h + TQueue.h + Utils.h + # Or add other shared files here + PRIVATE + ReadNames.cpp + ReadGraph.cpp + ReadSongs.cpp + FileReaderUtils.cpp + TDoublyLinkedList.cpp + TStack.cpp + TQueue.cpp + Utils.cpp +) + +# --- Step 3: Make Headers "Findable" --- + +# This is the most important command here. +# It tells any other project that links to "SharedLib" to add this +# directory (CMAKE_CURRENT_SOURCE_DIR) to its list of include paths. +# This is what allows you to write #include "list.hpp" in your main.cpp. +# Note: CMAKE_CURRENT_SOURCE_DIR is a built-in variable that points to the directory +target_include_directories(SharedLib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + diff --git a/Exam/IKT203Exam/Portfolio/SharedLib/FileReaderUtils.cpp b/Exam/IKT203Exam/Portfolio/SharedLib/FileReaderUtils.cpp new file mode 100644 index 0000000..175242c --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/SharedLib/FileReaderUtils.cpp @@ -0,0 +1,32 @@ +#include "FileReaderUtils.h" + +#include "FileReaderUtils.h" + +int GetRecordCount(const std::string& aHeaderLine) +{ + size_t recordPos = aHeaderLine.find("records:="); + if (recordPos == std::string::npos) + { + return 0; // No record count found + } + + size_t countStart = recordPos + 9; // Length of "records:=" + + // Find the end bracket ']' or a potential semicolon ';' + size_t countEnd = aHeaderLine.find_first_of("];", countStart); + if (countEnd == std::string::npos) + { + return 0; // Malformed header + } + + std::string countStr = aHeaderLine.substr(countStart, countEnd - countStart); + try + { + // stoi = string to integer + return std::stoi(countStr); + } + catch (const std::exception&) + { + return 0; // Malformed number + } +} \ No newline at end of file diff --git a/Exam/IKT203Exam/Portfolio/SharedLib/FileReaderUtils.h b/Exam/IKT203Exam/Portfolio/SharedLib/FileReaderUtils.h new file mode 100644 index 0000000..8d000d6 --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/SharedLib/FileReaderUtils.h @@ -0,0 +1,13 @@ +// FileReaderUtils.h +#pragma once +#if !defined(FILEREADERUTILS_H) +#define FILEREADERUTILS_H +#include +/** + * @brief [Internal] Safely parses the "records:=N" part of a header line. + * @param aHeaderLine The line, e.g., "[NODES;records:=11]" + * @return The number of records, or 0 if not found. + */ +int GetRecordCount(const std::string& aHeaderLine); + +#endif // FILEREADERUTILS_H \ No newline at end of file diff --git a/Exam/IKT203Exam/Portfolio/SharedLib/ReadGraph.cpp b/Exam/IKT203Exam/Portfolio/SharedLib/ReadGraph.cpp new file mode 100644 index 0000000..69c6e20 --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/SharedLib/ReadGraph.cpp @@ -0,0 +1,109 @@ +#include +#include +#include +#include +#include "SharedLib.h" +#include "FileReaderUtils.h" + +// --- Enum for the parser's state --- +enum class EParseState +{ + NONE, + NODES, + EDGES +}; + +void readGraphFromFile(const std::string& aFilename, FNodeRead aOnNodeRead, FEdgeRead aOnEdgeRead) +{ + if (aFilename.empty()) return; + + std::ifstream file(aFilename); + if (!file.is_open()) + { + // Optional: print an error + // std::cerr << "Error: Could not open file " << aFilename << std::endl; + return; + } + + std::string line; + EParseState currentState = EParseState::NONE; + int totalCount = 0; + int currentIndex = 0; + bool keepReading = true; + + while (keepReading && std::getline(file, line)) + { + if (line.empty()) continue; + + if (line[0] == '[') + { + // --- 2. USE THE SHARED FUNCTION --- + totalCount = GetRecordCount(line); + currentIndex = 0; + + if (line.find("[NODES") != std::string::npos) + { + currentState = EParseState::NODES; + continue; + } + else if (line.find("[EDGES") != std::string::npos) + { + currentState = EParseState::EDGES; + continue; + } + // If it's a comment or other header, reset state and count + currentState = EParseState::NONE; + totalCount = 0; + continue; + } + + // Process data based on the current state + switch (currentState) + { + case EParseState::NODES: + if (aOnNodeRead) + { + if (!aOnNodeRead(currentIndex, totalCount, line)) + { + keepReading = false; + } + currentIndex++; + } + break; + + case EParseState::EDGES: + { + std::istringstream edgeStream(line); + std::string fromNode, toNode, weightStr; + + if (std::getline(edgeStream, fromNode, ';') && + std::getline(edgeStream, toNode, ';') && + std::getline(edgeStream, weightStr)) + { + try + { + // Use std::stof (string to float) for weight + float weight = std::stof(weightStr); + if (aOnEdgeRead) + { + if (!aOnEdgeRead(currentIndex, totalCount, fromNode, toNode, weight)) + { + keepReading = false; + } + currentIndex++; + } + } + catch (const std::exception&) + { + // Failed to parse float, skip this line + } + } + break; + } + case EParseState::NONE: + default: + break; + } + } + file.close(); +} \ No newline at end of file diff --git a/Exam/IKT203Exam/Portfolio/SharedLib/ReadNames.cpp b/Exam/IKT203Exam/Portfolio/SharedLib/ReadNames.cpp new file mode 100644 index 0000000..a3407ac --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/SharedLib/ReadNames.cpp @@ -0,0 +1,55 @@ +#include +#include +#include +#include +#include "SharedLib.h" +#include "FileReaderUtils.h" + +void readNamesFromFile(const std::string& aFilename, FNameRead aOnNameRead) +{ + if (aFilename.empty()) return; + + std::ifstream file(aFilename); + if (!file.is_open()) + { + std::cerr << "Error: Could not open file " << aFilename << std::endl; + return; + } + + std::string line; + int totalCount = 0; + int currentIndex = 0; + bool keepReading = true; + + // --- 1. Read the header line --- + if (std::getline(file, line)) + { + // Use our shared helper to get the count + totalCount = GetRecordCount(line); + } + + // --- 2. Loop through the rest of the file --- + while (keepReading && std::getline(file, line)) + { + if (line.empty()) continue; + + std::istringstream nameStream(line); + std::string firstName, lastName; + + // Parse "FirstName LastName" + if (nameStream >> firstName >> lastName) + { + if (aOnNameRead) + { + // Call the callback with all parameters + if (!aOnNameRead(currentIndex, totalCount, firstName, lastName)) + { + keepReading = false; + } + currentIndex++; + } + } + } + + file.close(); +} \ No newline at end of file diff --git a/Exam/IKT203Exam/Portfolio/SharedLib/ReadSongs.cpp b/Exam/IKT203Exam/Portfolio/SharedLib/ReadSongs.cpp new file mode 100644 index 0000000..6460ae2 --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/SharedLib/ReadSongs.cpp @@ -0,0 +1,60 @@ +#include +#include +#include +#include +#include "SharedLib.h" +#include "FileReaderUtils.h" // Include the shared utility + +void ReadSongsFromFile(const std::string& aFilename, FSongRead aOnSongRead) +{ + if (aFilename.empty()) return; + + std::ifstream file(aFilename); + if (!file.is_open()) + { + // std::cerr << "Error: Could not open file " << aFilename << std::endl; + return; + } + + std::string line; + int totalCount = 0; + int currentIndex = 0; + bool keepReading = true; + + // --- 1. Read the header line --- + if (std::getline(file, line)) + { + // Use our shared helper to get the count + totalCount = GetRecordCount(line); + } + + // --- 2. Loop through the rest of the file (the data lines) --- + while (keepReading && std::getline(file, line)) + { + if (line.empty()) continue; // Skip empty lines + + std::istringstream lineStream(line); + std::string artist, title, year, genre, source; + + // Parse the five semicolon-separated fields + // Artist;Title;Year;Genre;Source + if (std::getline(lineStream, artist, ';') && + std::getline(lineStream, title, ';') && + std::getline(lineStream, year, ';') && + std::getline(lineStream, genre, ';') && + std::getline(lineStream, source)) // Last one reads to end of line + { + if (aOnSongRead) + { + // Call the callback with all parameters + if (!aOnSongRead(currentIndex, totalCount, artist, title, year, genre, source)) + { + keepReading = false; + } + currentIndex++; + } + } + } + + file.close(); +} \ No newline at end of file diff --git a/Exam/IKT203Exam/Portfolio/SharedLib/SharedLib.h b/Exam/IKT203Exam/Portfolio/SharedLib/SharedLib.h new file mode 100644 index 0000000..553ad6c --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/SharedLib/SharedLib.h @@ -0,0 +1,100 @@ +#pragma once +#ifndef SHARED_LIB_H +#define SHARED_LIB_H +#include +#include + +/// +/// Delegate type for processing a name read from a file. +/// +/// The index of the name (0-based). +/// The total number of names. +/// The first name read from the file. +/// The last name read from the file. +/// Returns true to continue reading, false to stop. +typedef bool (*FNameRead)( + const int aIndex, + const int aTotalCount, + const std::string& aFirstName, + const std::string& aLastName + ); + +/// +/// Use this function to read names from a specified file and process them using a callback function. +/// +/// readNamesFromFile +/// Reads names from a specified file and invokes a callback for each name read. +/// The path to the file containing names. +/// A callback function that is called for each name read. It takes two parameters: firstName and lastName. If the callback returns false, the reading process stops. +/// The first name read from the file. +/// The last name read from the file. +/// None. +void readNamesFromFile(const std::string& aFilename, FNameRead aOnNameRead); + +/// +/// Delegate type for processing a node read from the file. +/// +/// Function pointer type for a callback that processes nodes read from a file. +/// The index of the node (0-based). +/// The total number of nodes. +/// The node std::string. +/// Returns true to continue reading, false to stop. +typedef bool (*FNodeRead)(const int aIndex, const int aTotalCount, const std::string& aNode); + +/// +/// Delegate type for processing an edge read from the file. +/// +/// Function pointer type for a callback that processes edges read from a file. +/// The index of the edge (0-based). +/// The total number of edges. +/// The from node std::string. +/// The to node std::string. +/// The weight of the edge. +/// Returns true to continue reading, false to stop. +typedef bool (*FEdgeRead)(const int aIndex, const int aTotalCount, const std::string& aFromNode, const std::string& aToNode, float aWeight); + +/// +/// Use this function to read a graph from a specified file and process its nodes and edges using callback functions. +/// +/// readGraphFromFile +/// +/// Reads a graph from a specified file and invokes callbacks for each node and edge read. +/// All nodes are read first, followed by edges. +/// +/// The path to the file containing the graph data. +/// A callback function that is called for each node read. It takes one parameter: the node std::string. If the callback returns false, the reading process stops. +/// A callback function that is called for each edge read. It takes three parameters: the fromNode std::string, the toNode std::string, and the weight float. If the callback returns false, the reading process stops. +void readGraphFromFile(const std::string& aFilename, FNodeRead aOnNodeRead, FEdgeRead aOnEdgeRead); + + +/// +/// Delegate type for processing a song read from the file. +/// +/// The index of the song (0-based). +/// The total number of songs. +/// The artist. +/// The title. +/// The release year (as a std::string). +/// The genre. +/// The source. +/// Returns true to continue reading, false to stop. +typedef bool (*FSongRead)( + const int aIndex, + const int aTotalCount, + const std::string& aArtist, + const std::string& aTitle, + const std::string& aYear, + const std::string& aGenre, + const std::string& aSource + ); + +/// +/// Reads song data from a file and processes them using a callback. +/// This function automatically skips the "records:=" header. +/// +/// The path to the file (e.g., "songs.txt"). +/// The callback function called for each song. +void ReadSongsFromFile(const std::string& aFilename, FSongRead aOnSongRead); + + +#endif // SHARED_LIB_H \ No newline at end of file diff --git a/Exam/IKT203Exam/Portfolio/SharedLib/TDoublyLinkedList.cpp b/Exam/IKT203Exam/Portfolio/SharedLib/TDoublyLinkedList.cpp new file mode 100644 index 0000000..c019851 --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/SharedLib/TDoublyLinkedList.cpp @@ -0,0 +1,114 @@ +#include "TDoublyLinkedList.h" +#include +#include "SharedLib.h" + + + +void TDoublyLinkedList::Append(const std::string& line) +{ + auto* newNode = new Node(line); + if (size == 0) + head = tail = newNode; + else { + newNode->SetPrev(tail); + tail->SetNext(newNode); + tail = newNode; + } + size++; +} + +void TDoublyLinkedList::Prepend(const std::string& line) +{ + auto* newNode = new Node(line); + if (size == 0) + head = tail = newNode; + else { + newNode->SetNext(head); + head->SetPrev(newNode); + head = newNode; + } + size++; +} + +TDoublyLinkedList::Node* TDoublyLinkedList::NavigateToNode(const int index) const +{ + if (index < 0 || index >= size) + return nullptr; + + auto* node = head; + + for (int i = 0; i < index; i++) + node = node->GetNext(); + + return node; +} + +void TDoublyLinkedList::Remove(const int index) +{ + auto* node = NavigateToNode(index); + if (!node) + return; + + if (node->GetPrev()) + node->GetPrev()->SetNext(node->GetNext()); + else + head = node->GetNext(); + if (node->GetNext()) + node->GetNext()->SetPrev(node->GetPrev()); + else + tail = node->GetPrev(); + + delete node; + size--; +} + +std::string TDoublyLinkedList::GetAtIndex(const int index) const +{ + const auto* node = NavigateToNode(index); + return node ? node->GetLine() : "Error, line does not exist\n"; +} + +void TDoublyLinkedList::InsertAtIndex(const int index, const std::string &line) +{ + if (index < 0 || index > size) { + std::cout << "========\nIndex doesn't exist\n========\n" << std::endl; + return; + } + if (index == 0) + { + Prepend(line); + return; + } + if (index == size) + { + Append(line); + return; + } + Node* cur = head; + for (int i = 0; i < index; i++) + cur = cur->GetNext(); + Node* newNode = new Node(line); + Node* prev = cur->GetPrev(); + + newNode->SetPrev(prev); + newNode->SetNext(cur); + + prev->SetNext(newNode); + cur->SetPrev(newNode); + + size++; +} + + +int TDoublyLinkedList::GetSize() const +{ + return size; +} + + + + + + + + diff --git a/Exam/IKT203Exam/Portfolio/SharedLib/TDoublyLinkedList.h b/Exam/IKT203Exam/Portfolio/SharedLib/TDoublyLinkedList.h new file mode 100644 index 0000000..cf9c1c4 --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/SharedLib/TDoublyLinkedList.h @@ -0,0 +1,60 @@ +#ifndef TDOUBLYLINKEDLIST_H +#define TDOUBLYLINKEDLIST_H +#include +#include +#include "SharedLib.h" + + + +class TDoublyLinkedList { + +private: + struct Node { + std::string line; + Node* next; + Node* prev; + explicit Node(std::string text) : line(std::move(text)), next(nullptr), prev(nullptr) {} + + void SetNext(Node* node) + { + this->next = node; + } + void SetPrev(Node* node) + { + this->prev = node; + } + [[nodiscard]] Node* GetPrev() const + { + return this->prev; + } + [[nodiscard]] Node* GetNext() const + { + return this->next; + } + [[nodiscard]] std::string GetLine() const + { + return line; + } + + }; + + Node* head; + Node* tail; + int size; + + +public: + TDoublyLinkedList() : head(nullptr), tail(nullptr), size(0) {} + ~TDoublyLinkedList() = default; + + void Append(const std::string &line); + void Prepend(const std::string& line); + [[nodiscard]] Node* NavigateToNode(int index) const; + void Remove(int index); + [[nodiscard]] std::string GetAtIndex(int index) const; + void InsertAtIndex(int index, const std::string &line); + [[nodiscard]] int GetSize() const; +}; + + +#endif //TDOUBLYLINKEDLIST_H \ No newline at end of file diff --git a/Exam/IKT203Exam/Portfolio/SharedLib/TQueue.cpp b/Exam/IKT203Exam/Portfolio/SharedLib/TQueue.cpp new file mode 100644 index 0000000..e30fbff --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/SharedLib/TQueue.cpp @@ -0,0 +1,47 @@ +#include "TQueue.h" + +#include + + +void TQueue::Enqueue(const std::string& text) +{ + if (IsFull()) + throw std::overflow_error("Queue Overflow"); + queue[tail] = text; + tail = (tail + 1) % MAX_SIZE; + count++; +} + +std::string TQueue::Dequeue() +{ + if (IsEmpty()) + throw std::underflow_error("Empty Queue"); + const std::string item = queue[head]; + head = (head + 1) % MAX_SIZE; + count--; + return item; +} + +std::string TQueue::Peek() const +{ + if (IsEmpty()) + throw std::underflow_error("Empty Queue"); + return queue[head]; +} + +bool TQueue::IsEmpty() const +{ + return count == 0; +} + +bool TQueue::IsFull() const +{ + return count == MAX_SIZE; +} + +int TQueue::GetTail() const +{ + if (IsEmpty()) + throw std::underflow_error("Empty Queue"); + return tail; +} diff --git a/Exam/IKT203Exam/Portfolio/SharedLib/TQueue.h b/Exam/IKT203Exam/Portfolio/SharedLib/TQueue.h new file mode 100644 index 0000000..6a80dd4 --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/SharedLib/TQueue.h @@ -0,0 +1,28 @@ +#ifndef TQUEUE_H +#define TQUEUE_H +#define MAX_SIZE 100 + +#include "TDoublyLinkedList.h" + + +class TQueue { +private: + std::string queue[MAX_SIZE]; + int head = 0; + int tail = 0; + int count = 0; + +public: + TQueue() = default; + ~TQueue() = default; + + void Enqueue(const std::string& text); + std::string Dequeue(); + [[nodiscard]] int GetTail() const; + [[nodiscard]] std::string Peek() const; + [[nodiscard]] bool IsEmpty() const; + [[nodiscard]] bool IsFull() const; +}; + + +#endif //TQUEUE_H \ No newline at end of file diff --git a/Exam/IKT203Exam/Portfolio/SharedLib/TStack.cpp b/Exam/IKT203Exam/Portfolio/SharedLib/TStack.cpp new file mode 100644 index 0000000..6f957c1 --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/SharedLib/TStack.cpp @@ -0,0 +1,36 @@ +#include "TStack.h" +#include + +void TStack::Push(const TAction& action) +{ + if (top >= STACK_MAX_SIZE) + throw std::overflow_error("Stack overflow"); + event[top++] = action; +} + +TStack::TAction TStack::Pop() +{ + if (top == 0) + throw std::underflow_error("Stack empty"); + return event[--top]; +} + +TStack::TAction TStack::Peek() const +{ + if (top == 0) + throw std::underflow_error("Stack empty"); + return event[top - 1]; +} + +bool TStack::IsEmpty() const +{ + return top == 0; +} + +void TStack::Clear() +{ + for (int i = 0; i < top; i++) { + this->Pop(); + } +} + diff --git a/Exam/IKT203Exam/Portfolio/SharedLib/TStack.h b/Exam/IKT203Exam/Portfolio/SharedLib/TStack.h new file mode 100644 index 0000000..e15cc0c --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/SharedLib/TStack.h @@ -0,0 +1,37 @@ +#ifndef TSTACK_H +#define TSTACK_H + +#define STACK_MAX_SIZE 100 +#include + + +enum EnumActionType { + INSERT, + DELETE +}; + +class TStack { +private: + struct TAction { + EnumActionType action; + std::string text; + int index; + }; + + TAction event[STACK_MAX_SIZE]{}; + int top = 0; + +public: + TStack() = default; + ~TStack() = default; + + void Push(const TAction& action); + TAction Pop(); + [[nodiscard]] TAction Peek() const; + [[nodiscard]] bool IsEmpty() const; + void Clear(); + +}; + + +#endif //TSTACK_H \ No newline at end of file diff --git a/Exam/IKT203Exam/Portfolio/SharedLib/Utils.cpp b/Exam/IKT203Exam/Portfolio/SharedLib/Utils.cpp new file mode 100644 index 0000000..74ef15a --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/SharedLib/Utils.cpp @@ -0,0 +1,78 @@ +#include "Utils.h" + +#include +#include + +#include "TDoublyLinkedList.h" +#include "TStack.h" + + +int Utils::Choice() +{ + std::cout << "========\n1. Add line\n2. Remove line\n3. Print current document\n4. Print queue\n5. Undo\n6. Redo\n0. Exit" + "\n\nChoice: "; + int choice; + std::cin >> choice; + std::cin.ignore(std::numeric_limits::max(), '\n'); + //std::cout << "\n=====================\n"; + return choice; +} + +int Utils::Insert(TDoublyLinkedList &document, TStack &undoStack, TStack &redoStack, int index) +{ + for (int i = 0; i < document.GetSize(); i++) { + std::cout << i + 1 << ". " << document.GetAtIndex(i) << std::endl; + } + if (document.GetSize() > 0) + { + std::cout << "Enter the line number where you want to insert the line" <> index)) { + std::cin.clear(); + std::cin.ignore(std::numeric_limits::max(), '\n'); + std::cout << "========\nIndex must be a number\n========\n\n" << std::endl; + return index; + } + + std::cin.ignore(std::numeric_limits::max(), '\n'); + } + if (document.GetSize() < 1) + index = 1; + + std::cout << "Enter the text" <> index)) { + std::cin.clear(); + std::cin.ignore(std::numeric_limits::max(), '\n'); + std::cout << "========\nIndex must be a number\n========\n\n" << std::endl; + return index; + } std::cin.ignore(std::numeric_limits::max(), '\n'); + const std::string deletedLine = document.GetAtIndex(index-1); + document.Remove(index-1); + undoStack.Push({DELETE, deletedLine, index-1}); + if (!redoStack.IsEmpty()) { + redoStack.Clear(); + } + return index; +} diff --git a/Exam/IKT203Exam/Portfolio/SharedLib/Utils.h b/Exam/IKT203Exam/Portfolio/SharedLib/Utils.h new file mode 100644 index 0000000..29bbe3f --- /dev/null +++ b/Exam/IKT203Exam/Portfolio/SharedLib/Utils.h @@ -0,0 +1,26 @@ +#ifndef UTILS_H +#define UTILS_H +#include "TDoublyLinkedList.h" +#include "TStack.h" + + +class Utils { + public: + static int Choice(); + static int Insert(TDoublyLinkedList &document, TStack &undoStack, TStack &redoStack, int index); + static void PrintList(const TDoublyLinkedList &document); + static int RemoveLine(TDoublyLinkedList &document, TStack &undoStack, TStack &redoStack, int index); + + + + + + + + + + +}; + + +#endif //PART1_UTILS_H \ No newline at end of file diff --git a/Exam/IKT203Exam/Submissions/CMakeLists.txt b/Exam/IKT203Exam/Submissions/CMakeLists.txt new file mode 100644 index 0000000..9f5ad33 --- /dev/null +++ b/Exam/IKT203Exam/Submissions/CMakeLists.txt @@ -0,0 +1,19 @@ +# CMakeList.txt : Top-level CMake project file, do global configuration +# and include sub-projects here. +# +cmake_minimum_required (VERSION 3.20) + +# Enable Hot Reload for MSVC compilers if supported. +if (POLICY CMP0141) + cmake_policy(SET CMP0141 NEW) + set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$,$>,$<$:EditAndContinue>,$<$:ProgramDatabase>>") +endif() + +project ("Exercises") + +# Include sub-projects. +add_subdirectory ("Submission-01") +add_subdirectory ("Submission-02") +add_subdirectory ("Submission-03") +add_subdirectory ("Submission-04") +add_subdirectory ("Submission-05") diff --git a/Exam/IKT203Exam/Submissions/Submission-01/CMakeLists.txt b/Exam/IKT203Exam/Submissions/Submission-01/CMakeLists.txt new file mode 100644 index 0000000..e72a1e6 --- /dev/null +++ b/Exam/IKT203Exam/Submissions/Submission-01/CMakeLists.txt @@ -0,0 +1,13 @@ +# CMakeList.txt : CMake project for Submission-01, include source and define +# project specific logic here. +# + +# Add source to this project's executable. +add_executable (Submission-01 "main.cpp" "main.h") +target_link_libraries(Submission-01 PRIVATE LibExample) + +if (CMAKE_VERSION VERSION_GREATER 3.20) + set_property(TARGET Submission-01 PROPERTY CXX_STANDARD 20) +endif() + +# TODO: Add tests and install targets if needed. diff --git a/Exam/IKT203Exam/Submissions/Submission-01/main.cpp b/Exam/IKT203Exam/Submissions/Submission-01/main.cpp new file mode 100644 index 0000000..d1921ec --- /dev/null +++ b/Exam/IKT203Exam/Submissions/Submission-01/main.cpp @@ -0,0 +1,309 @@ +// Submission-01.cpp : Defines the entry point for the application. +// + +#include "main.h" +#include + + + +// Movie class with bitwise genre flags +enum EGenreFlags { + Action = 0x0001, + Comedy = 0x0002, + Drama = 0x0004, + Horror = 0x0008, + SciFi = 0x0010, + Romance = 0x0020, + Documentary = 0x0040, + Thriller = 0x0080, + Crime = 0x0100, + Fantasy = 0x0200, + Animation = 0x0400, + Adventure = 0x0800 +}; + +static std::string GenreFlagsToString(int genreFlags) { + std::string result; + if (genreFlags & EGenreFlags::Action) result += "Action "; + if (genreFlags & EGenreFlags::Comedy) result += "Comedy "; + if (genreFlags & EGenreFlags::Drama) result += "Drama "; + if (genreFlags & EGenreFlags::Horror) result += "Horror "; + if (genreFlags & EGenreFlags::SciFi) result += "SciFi "; + if (genreFlags & EGenreFlags::Romance) result += "Romance "; + if (genreFlags & EGenreFlags::Documentary) result += "Documentary "; + if (genreFlags & EGenreFlags::Thriller) result += "Thriller "; + if (genreFlags & EGenreFlags::Crime) result += "Crime "; + if (genreFlags & EGenreFlags::Fantasy) result += "Fantasy "; + if (genreFlags & EGenreFlags::Animation) result += "Animation "; + if (genreFlags & EGenreFlags::Adventure) result += "Adventure "; + return result.empty() ? "None" : result; +} + +// Movie class definition +class TMovie { +private: + std::string title; + std::string director; + int year; + int genreFlags; // Bitwise combination of EGenreFlags + float rating; // Scale from 0.0 to 10.0 + +public: + TMovie(std::string t, std::string d, int y, int g, float r) + : title(t), director(d), year(y), genreFlags(g), rating(r) {} + void PrintInfo() const { + std::cout << "Title: " << title << "\nDirector: " << director + << "\nYear: " << year << "\nGenres: " << GenreFlagsToString(genreFlags) + << "\nRating: " << rating << "/10\n"; + } + std::string GetTitle() const { return title; } + std::string GetDirector() const { return director; } + int GetYear() const { return year; } + float GetRating() const { return rating; } + int GetGenreFlags() const { return genreFlags; } + bool HasGenre(EGenreFlags genre) const { + return (genreFlags & genre) != 0; + } +}; + +typedef bool (*FCheckMovie)(TMovie*, void*); +typedef void (*FMovieIndex)(TMovie*, int); + +// Doubly Linked List TMovieNode definition +struct TMovieNode { + TMovie* movie; + TMovieNode* next; + TMovieNode* prev; + TMovieNode(TMovie* m) : movie(m), next(nullptr), prev(nullptr) {} +}; + +// Doubly Linked List class definition with dummy node, head, and tail O(1) operations +class TMovieList { + private: + TMovieNode* head; // Always points to dummy node + TMovieNode* tail; + int size; + + // Helper function to get node at index + TMovieNode* InternalGetAtIndex(int aIndex) { + if (aIndex < 0 || aIndex >= size) return nullptr; + TMovieNode* current; + // Optimize traversal direction, if index is in the first half, start from head, else from tail + if (aIndex < size / 2) { + current = head->next; // Start from the beginning + for (int i = 0; i < aIndex; i++) { + current = current->next; + } + } + else { + current = tail; // Start from the end + for (int i = size - 1; i > aIndex; i--) { + current = current->prev; + } + } + return current; + } + +public: + TMovieList() { + head = new TMovieNode(nullptr); // Dummy node + tail = head; // Initially, tail is the same as head + size = 0; + } + ~TMovieList() { + Clear(); + delete head; // Delete dummy node + } + void Clear() { + TMovieNode* current = head->next; // Start from the first real node + while (current) { + TMovieNode* toDelete = current; + current = current->next; + delete toDelete->movie; + delete toDelete; + } + head->next = nullptr; + tail = head; // Reset tail to dummy node + size = 0; + } + + // Insertion at the end O(1) + void Append(TMovie* aMovie) { + TMovieNode* newNode = new TMovieNode(aMovie); + newNode->prev = tail; + tail->next = newNode; + tail = newNode; + size++; + } + + // Prepend at the beginning O(1) + void Prepend(TMovie* aMovie) { + TMovieNode* newNode = new TMovieNode(aMovie); + newNode->next = head->next; + newNode->prev = head; + if (head->next) { + head->next->prev = newNode; + } else { + tail = newNode; // If list was empty, update tail + } + head->next = newNode; + size++; + } + + // GetAtIndex O(n) check direction to optimize + TMovie* GetAtIndex(int aIndex) { + return InternalGetAtIndex(aIndex)->movie; + } + + // Remove at index O(n) use GetAtIndex to find node + bool RemoveAtIndex(int aIndex) { + if (aIndex < 0 || aIndex >= size) return false; + TMovieNode* toDelte = InternalGetAtIndex(aIndex); + if (!toDelte) return false; + if (toDelte->prev) { + toDelte->prev->next = toDelte->next; + } + if (toDelte->next) { + toDelte->next->prev = toDelte->prev; + } else { + tail = toDelte->prev; // Update tail if last node is removed + } + delete toDelte->movie; + delete toDelte; + size--; + return true; + } + + // Reverse the list O(n) + void Reverse() { + TMovieNode* current = head->next; + TMovieNode* prev = nullptr; + tail = head->next; + while (current) { + TMovieNode* nextNode = current->next; + current->next = prev; + current->prev = nextNode; + prev = current; + current = nextNode; + } + head->next = prev; + if (prev) { + prev->prev = head; + } + } + + // SearchFor O(n) + TMovie* SearchFor(FCheckMovie aCheckFunc, void* aUserData) { + TMovieNode* current = head->next; + while (current) { + if (aCheckFunc(current->movie, aUserData)) { + return current->movie; + } + current = current->next; + } + return nullptr; + } + + // Every movie in the list O(n) + void Every(FMovieIndex aIndexFunc) { + TMovieNode* current = head->next; + int index = 0; + while (current) { + aIndexFunc(current->movie, index); + current = current->next; + index++; + } + } + +}; + +using namespace std; + +static void PrintNode(std::string* data, int index) { + cout << "Node " << index << ": " << *data << endl; +} + +static bool CheckMovieByTitle(TMovie* movie, void* title) { + return movie->GetTitle() == *(static_cast(title)); +} + +static bool CheckMovieByDirector(TMovie* movie, void* director) { + return movie->GetDirector() == *(static_cast(director)); +} + +static bool FindAllMovieByGenre(TMovie* movie, void* genre) { + if(movie->HasGenre(*(static_cast(genre)))) { + movie->PrintInfo(); + std::cout << "-------------------" << std::endl; + } + // Always return false to continue searching + return false; +} + + +int main() +{ + + std::cout << "--- Submission 1: Linked List ---" << std::endl; + + // Create a movie list + TMovieList movieList; + // Add some movies + movieList.Append(new TMovie("Inception", "Christopher Nolan", 2010, EGenreFlags::Action | EGenreFlags::SciFi, 8.8f)); + movieList.Append(new TMovie("The Godfather", "Francis Ford Coppola", 1972, EGenreFlags::Crime | EGenreFlags::Drama, 9.2f)); + movieList.Prepend(new TMovie("Toy Story", "John Lasseter", 1995, EGenreFlags::Animation | EGenreFlags::Adventure | EGenreFlags::Comedy, 8.3f)); + movieList.Append(new TMovie("The Dark Knight", "Christopher Nolan", 2008, EGenreFlags::Action | EGenreFlags::Crime | EGenreFlags::Drama, 9.0f)); + // Print movie info + for (int i = 0; i < 3; i++) { + TMovie* movie = movieList.GetAtIndex(i); + if (movie) { + movie->PrintInfo(); + std::cout << "-------------------" << std::endl; + } + } + std::cout << std::endl; + // Wait for user input to proceed + std::cout << "Press Enter to continue..." << std::endl; + std::cin.get(); + + // Search for a movie by title + std::string searchTitle = "Inception"; + TMovie* foundMovie = movieList.SearchFor(CheckMovieByTitle, &searchTitle); + if (foundMovie) { + std::cout << "Found movie by title '" << searchTitle << "':" << std::endl; + foundMovie->PrintInfo(); + } else { + std::cout << "Movie with title '" << searchTitle << "' not found." << std::endl; + } + std::cout << "-------------------" << std::endl; + std::cout << std::endl; + + // Search for a movie by director + std::string searchDirector = "John Lasseter"; + foundMovie = movieList.SearchFor(CheckMovieByDirector, &searchDirector); + if (foundMovie) { + std::cout << "Found movie by director '" << searchDirector << "':" << std::endl; + foundMovie->PrintInfo(); + } else { + std::cout << "Movie with director '" << searchDirector << "' not found." << std::endl; + } + std::cout << "-------------------" << std::endl; + std::cout << std::endl; + + // Find all movies in the Action genre + EGenreFlags searchGenre = EGenreFlags::Action; + std::cout << "Movies in the Action genre:" << std::endl; + movieList.SearchFor(FindAllMovieByGenre, &searchGenre); + std::cout << std::endl; + + // Reverse the list + movieList.Reverse(); + std::cout << "Movies after reversing the list:" << std::endl; + movieList.Every([](TMovie* movie, int index) { + std::cout << "Index " << index << ":" << std::endl; + movie->PrintInfo(); + std::cout << "-------------------" << std::endl; + }); + + return 0; +} diff --git a/Exam/IKT203Exam/Submissions/Submission-01/main.h b/Exam/IKT203Exam/Submissions/Submission-01/main.h new file mode 100644 index 0000000..ccf6e27 --- /dev/null +++ b/Exam/IKT203Exam/Submissions/Submission-01/main.h @@ -0,0 +1,8 @@ +// Submission-01.h : Include file for standard system include files, +// or project specific include files. + +#pragma once + +#include + +// TODO: Reference additional headers your program requires here. diff --git a/Exam/IKT203Exam/Submissions/Submission-02/CMakeLists.txt b/Exam/IKT203Exam/Submissions/Submission-02/CMakeLists.txt new file mode 100644 index 0000000..28e1424 --- /dev/null +++ b/Exam/IKT203Exam/Submissions/Submission-02/CMakeLists.txt @@ -0,0 +1,13 @@ +# CMakeList.txt : CMake project for Submission-01, include source and define +# project specific logic here. +# + +# Add source to this project's executable. +add_executable (Submission-02 "main.cpp" "main.h") +target_link_libraries(Submission-02 PRIVATE LibExample) + +if (CMAKE_VERSION VERSION_GREATER 3.20) + set_property(TARGET Submission-02 PROPERTY CXX_STANDARD 20) +endif() + +# TODO: Add tests and install targets if needed. diff --git a/Exam/IKT203Exam/Submissions/Submission-02/main.cpp b/Exam/IKT203Exam/Submissions/Submission-02/main.cpp new file mode 100644 index 0000000..dcad68d --- /dev/null +++ b/Exam/IKT203Exam/Submissions/Submission-02/main.cpp @@ -0,0 +1,121 @@ +// Submission-01.cpp : Defines the entry point for the application. +// + +#include "main.h" +#include + + +// printNaturalNumbers +static void printNaturalNumbers(int aN) +{ + if (aN <= 0) return; // Base case: if n is less than or equal to 0, do nothing + printNaturalNumbers(aN - 1); // Recursive call with n-1 + std::cout << aN << " "; // Print the number after the recursive call to achieve ascending order +} + +// factorial function +static int calculateFactorial(int aN) +{ + if (aN <= 1) return 1; // Base case: factorial of 0 or 1 is 1 + return aN * calculateFactorial(aN - 1); // Recursive call +} + +// power function using exponentiation by squaring +// This method is more efficient than the naive approach, reducing the time complexity from O(n) to O(log n). +static int power(int aBase, int aExponent) +{ + if (aExponent == 0) return 1; // Base case: any number to the power of 0 is 1 + if (aExponent < 0) return 1 / power(aBase, -aExponent); // Handle negative exponents + if (aExponent % 2 == 0) // If exponent is even + { + int halfPower = power(aBase, aExponent / 2); + return halfPower * halfPower; // (x^(n/2))^2 + } + else // If exponent is odd + { + return aBase * power(aBase, aExponent - 1); // x * x^(n-1) + } +} + +// Fibonacci function +// Note: This naive recursive solution is inefficient because it recalculates the same Fibonacci numbers multiple times, leading to an exponential time complexity of O(2^n). +// An improvement could be made by using memoization or an iterative approach to store previously calculated values, reducing the time complexity to O(n). +static int fibonacci(int aN) +{ + if (aN <= 0) return 0; // Base case: fibonacci(0) = 0 + if (aN == 1) return 1; // Base case: fibonacci(1) = 1 + int a = fibonacci(aN - 1); + int b = fibonacci(aN - 2); + std::cout << a << " + " << b << " = " << (a + b) << std::endl; // Print the sum of the two preceding numbers + return a + b; // Recursive call +} + +// Count occurrences of a character in a string +// This function counts how many times a specific character appears in a given string using recursion. +static int countOccurrences(const char* aS, char aC) +{ + if (*aS == '\0') return 0; // Base case: end of string + return (*aS == aC ? 1 : 0) + countOccurrences(aS + 1, aC); // Check current character and recurse for the rest of the string +} + +// Find the largest element in an array using binary recursion +// This function divides the array into two halves, finds the largest element in each half recursively, and then returns the larger of the two. +static int findLargestElement(int arr[], int size) +{ + if (size == 1) return arr[0]; // Base case: only one element + int mid = size / 2; + int leftMax = findLargestElement(arr, mid); // Find max in left half + int rightMax = findLargestElement(arr + mid, size - mid); // Find max in right half + return (leftMax > rightMax) ? leftMax : rightMax; // Return the larger of the two +} + +// Traverse and print characters in the ASCII table from aStart to aEnd using recursion +// This function prints characters in ascending order during the building phase of the recursion and in descending order during the unwinding phase. +static void traverseAsciiTable(char aStart, char aEnd) +{ + if (aStart > aEnd) return; // Base case: if start exceeds end, do nothing + std::cout << aStart << " "; // Print before the recursive call + traverseAsciiTable(aStart + 1, aEnd); // Recursive call with next character + std::cout << aStart << " "; // Print after the recursive call +} + +int main() +{ + std::cout << "--- Submission 2: Fundamental Recursion ---" << std::endl; + std::cout << std::endl << "Part 1: Linear Recursion - Your First Steps" << std::endl; + printNaturalNumbers(5); + std::cout << std::endl << "------------------------------------------------" << std::endl; + + std::cout << std::endl << "Factorial of 5: " << calculateFactorial(5); + std::cout << std::endl << "------------------------------------------------" << std::endl; + + std::cout << std::endl << "Part 2: Multiple & Binary Recursion - Diving Deeper" << std::endl; + std::cout << std::endl << "2^10: " << power(2, 10); + std::cout << std::endl << "------------------------------------------------" << std::endl; + + std::cout << std::endl << "4th Fibonacci number: " << std::endl << fibonacci(4); + std::cout << std::endl << "------------------------------------------------" << std::endl; + + std::cout << std::endl << "Occurrences of 'l' in 'Hello, World!': " << countOccurrences("Hello, World!", 'l'); + std::cout << std::endl << "------------------------------------------------" << std::endl; + + int* arr = new int[20]; + // Fill array with random numbers from 0 to 999 + for (int i = 0; i < 20; ++i) arr[i] = rand() % 999; + std::cout << std::endl << "Part 3: Advanced Binary Recursion" << std::endl; + // Print first 20 elements of the array + for (int i = 0; i < 20; ++i) std::cout << arr[i] << " "; + + std::cout << std::endl << "Largest element in array: " << findLargestElement(arr, 20); + std::cout << std::endl << "------------------------------------------------" << std::endl; + + std::cout << std::endl << "Traverse ASCII table from 'A' to 'Z':" << std::endl; + traverseAsciiTable('A', 'Z'); + + /* + Note: The output reflects the building and unwinding of the call stack. + */ + + std::cout << std::endl; + return 0; +} diff --git a/Exam/IKT203Exam/Submissions/Submission-02/main.h b/Exam/IKT203Exam/Submissions/Submission-02/main.h new file mode 100644 index 0000000..ccf6e27 --- /dev/null +++ b/Exam/IKT203Exam/Submissions/Submission-02/main.h @@ -0,0 +1,8 @@ +// Submission-01.h : Include file for standard system include files, +// or project specific include files. + +#pragma once + +#include + +// TODO: Reference additional headers your program requires here. diff --git a/Exam/IKT203Exam/Submissions/Submission-03/CMakeLists.txt b/Exam/IKT203Exam/Submissions/Submission-03/CMakeLists.txt new file mode 100644 index 0000000..e5d6092 --- /dev/null +++ b/Exam/IKT203Exam/Submissions/Submission-03/CMakeLists.txt @@ -0,0 +1,13 @@ +# CMakeList.txt : CMake project for Submission-01, include source and define +# project specific logic here. +# + +# Add source to this project's executable. +add_executable (Submission-03 "main.cpp" "main.h") +target_link_libraries(Submission-03 PRIVATE LibExample) + +if (CMAKE_VERSION VERSION_GREATER 3.20) + set_property(TARGET Submission-03 PROPERTY CXX_STANDARD 20) +endif() + +# TODO: Add tests and install targets if needed. diff --git a/Exam/IKT203Exam/Submissions/Submission-03/main.cpp b/Exam/IKT203Exam/Submissions/Submission-03/main.cpp new file mode 100644 index 0000000..ae63d1c --- /dev/null +++ b/Exam/IKT203Exam/Submissions/Submission-03/main.cpp @@ -0,0 +1,439 @@ +// Submission-01.cpp : Defines the entry point for the application. +// + +#include "main.h" +#include + + +/* +Part 1: Implementing the Core Data Structures +These tasks are designed to get you comfortable with the Last-In, First-Out (LIFO) and First-In, First-Out (FIFO) principles. Building these yourself will give you a deep understanding of how they work under the hood! +*/ + +/* +1. Implementing a Stack: +a) Create a simple TStack class that can hold int values. +b) Use a fixed-size array and a top-of-stack index to manage the data. +c) Implement the core methods: Push(int item) and Pop(). +D) Add a Peek() method to view the top item without removing it. +e) Include an IsEmpty() method to check if the stack is empty. +*/ + +class TStackArray { +private: + int maxSize = 0; + int* stackArray = nullptr; + int top = -1; // Index of the top element +public: + TStackArray(int aSize) : maxSize(aSize) { + stackArray = new int[maxSize]; + } + ~TStackArray() { + delete[] stackArray; + } + void Push(int aItem) { + if (top < maxSize - 1) { + stackArray[++top] = aItem; + } + else { + std::cout << "Stack Overflow" << std::endl; + } + } + int Pop() { + if (!IsEmpty()) { + return stackArray[top--]; + } + else { + std::cout << "Stack Underflow" << std::endl; + return -1; // Indicate error + } + } + int Peek() const { + if (!IsEmpty()) { + return stackArray[top]; + } + else { + std::cout << "Stack is empty" << std::endl; + return -1; // Indicate error + } + } + bool IsEmpty() const { + return top == -1; + } +}; + + +/* +2. Implementing a Queue: +a) Create a simple TQueue class that can hold int values. +b) Use a fixed-size array and front/back indices to manage the data. +c) Implement the core methods: Enqueue(int item) and Dequeue(). +d) Add a Peek() method to view the item at the front without removing it. +e) Include an IsEmpty() method to check if the queue is empty. +*/ + +class TQueueArray { +private: + int maxSize = 0; + int* queueArray = nullptr; + int front = 0; // Index of the front element + int back = -1; // Index of the back element + int itemCount = 0; // Number of items in the queue +public: + TQueueArray(int aSize) : maxSize(aSize) { + queueArray = new int[maxSize]; + } + ~TQueueArray() { + delete[] queueArray; + } + void Enqueue(int aItem) { + if (itemCount < maxSize) { + back = (back + 1) % maxSize; // Circular increment + queueArray[back] = aItem; + itemCount++; + } + else { + std::cout << "Queue Overflow" << std::endl; + } + } + int Dequeue() { + if (!IsEmpty()) { + int item = queueArray[front]; + front = (front + 1) % maxSize; // Circular increment + itemCount--; + return item; + } + else { + std::cout << "Queue Underflow" << std::endl; + return -1; // Indicate error + } + } + int Peek() const { + if (!IsEmpty()) { + return queueArray[front]; + } + else { + std::cout << "Queue is empty" << std::endl; + return -1; // Indicate error + } + } + bool IsEmpty() const { + return itemCount == 0; + } +}; + +class TNodeInteger { +public: + int data; + TNodeInteger* next; + TNodeInteger(int aData) : data(aData), next(nullptr) {} +}; + +// Stack implemented using a linked list with dummy head node +class TStackLinkedList { +private: + TNodeInteger* top = nullptr; +public: + TStackLinkedList() { + top = new TNodeInteger(0); // Dummy head node + } + ~TStackLinkedList() { + while (!IsEmpty()) { + Pop(); + } + delete top; // Delete dummy head node + } + void Push(int aItem) { + TNodeInteger* newNode = new TNodeInteger(aItem); + newNode->next = top->next; + top->next = newNode; + } + int Pop() { + if (!IsEmpty()) { + TNodeInteger* temp = top->next; + int item = temp->data; + top->next = temp->next; + delete temp; // Free memory + return item; + } + else { + std::cout << "Stack Underflow" << std::endl; + return -1; // Indicate error + } + } + int Peek() const { + if (!IsEmpty()) { + return top->next->data; + } + else { + std::cout << "Stack is empty" << std::endl; + return -1; // Indicate error + } + } + bool IsEmpty() const { + return top->next == nullptr; + } +}; + +// Queue implemented using a linked list with dummy head node +class TQueueLinkedList { +private: + TNodeInteger* front = nullptr; + TNodeInteger* back = nullptr; +public: + TQueueLinkedList() { + front = new TNodeInteger(0); // Dummy head node + back = front; // Initially, front and back point to the dummy node + } + ~TQueueLinkedList() { + while (!IsEmpty()) { + Dequeue(); + } + delete front; // Delete dummy head node + } + void Enqueue(int aItem) { + TNodeInteger* newNode = new TNodeInteger(aItem); + back->next = newNode; + back = newNode; + } + int Dequeue() { + if (!IsEmpty()) { + TNodeInteger* temp = front->next; + int item = temp->data; + front->next = temp->next; + if (back == temp) { // If the dequeued node was the last node + back = front; // Reset back to the dummy head + } + delete temp; // Free memory + return item; + } + else { + std::cout << "Queue Underflow" << std::endl; + return -1; // Indicate error + } + } + int Peek() const { + if (!IsEmpty()) { + return front->next->data; + } + else { + std::cout << "Queue is empty" << std::endl; + return -1; // Indicate error + } + } + bool IsEmpty() const { + return front->next == nullptr; + } +}; + + + +/* +Part 2: Practical Applications +Now that you have your own data structures, it's time to put them to work! These are classic problems that perfectly demonstrate the LIFO and FIFO principles. +*/ + +/* +3. String Reversal with a Stack: +a) Write a function that takes a string as input and uses your TStack to return the reversed string. +b) In a short comment, explain why the stack is the perfect tool for this type of task. +*/ + +static std::string ReverseString(const char* aStr) { + TStackArray stack(strlen(aStr)); + for (int i = 0; aStr[i] != '\0'; i++) { + stack.Push(aStr[i]); + } + std::string reversed; + while (!stack.IsEmpty()) { + reversed += static_cast(stack.Pop()); // Cast int back to char + } + return reversed; + /* + * Note: The stack is the perfect tool for string reversal because it allows us to push each character of the string onto the stack and then pop them off in reverse order. + * And stack is using the rule of LIFO (Last In First Out), so the last character pushed onto the stack will be the first one to be popped off, effectively reversing the order of characters. + */ +} + +/* +4. Recursive Functions with a Stack: +a) Remember the factorial function you implemented with recursion in Submission 2? Your computer used a hidden "call stack" to make that happen. Now, your task is to re-implement that function without recursion, using your own `TStack` to manage the process. +b) This is a fantastic exercise that will give you a "eureka" moment about how recursion truly works! +*/ + +static int Factorial(int n) { + if (n < 0) return -1; // Factorial is not defined for negative numbers + if (n == 0 || n == 1) return 1; // Base case + TStackArray stack(n); + for (int i = 2; i <= n; i++) { + stack.Push(i); + } + int result = 1; + while (!stack.IsEmpty()) { + result *= stack.Pop(); + } + return result; +} + +/* +5. Wait Line Simulation with a Queue: +a) Simulate a simple waiting line, such as a ticket counter. +b) Use your TQueue to manage a list of people (represented by integer IDs). +c) People should Enqueue when they arrive and Dequeue when they are served, clearly demonstrating the FIFO principle. +*/ + +static void SimulateWaitLine() { + TQueueArray queue(5); // Queue with a maximum size of 5 + // Simulate people arriving + for (int i = 1; i <= 5; i++) { + std::cout << "Person " << i << " arrives." << std::endl; + queue.Enqueue(i); + } + // Simulate serving people + while (!queue.IsEmpty()) { + int person = queue.Dequeue(); + std::cout << "Person " << person << " is served." << std::endl; + } +} + +/* +Part 3: Advanced Traversal - Stacks vs. Queues +This is the main event! You will solve the same problem using two different approaches, highlighting the different strengths of stacks and queues. +Your recursive functions from Submission 2 actually use an implicit stack, so this task will give you a deeper look into how it all works. +*/ + +/* +6. Setup: The 100x100 Grid: +a) Create a 100x100 two-dimensional integer array. +b) Populate the array with random integer values between 0 and 9. +c) Choose a random starting cell (row, col). +d) Create a second 100x100 boolean array to keep track of visited cells. +*/ + + +static const int GRID_SIZE = 7; +static int grid[GRID_SIZE][GRID_SIZE]; +static bool visited[GRID_SIZE][GRID_SIZE] = { false }; +#include +#include +static void InitializeGrid() { + std::srand(static_cast(std::time(0))); // Seed for randomness + for (int i = 0; i < GRID_SIZE; i++) { + for (int j = 0; j < GRID_SIZE; j++) { + grid[i][j] = std::rand() % 9; // Random values between 0 and 9 + visited[i][j] = false; // Initialize visited array + } + } +} + +/* +7. Depth-First Search (DFS) with a Stack: +a) Write a function that uses your TStack to perform a DFS on the grid, starting from your random cell. +b) The goal is to find the first occurrence of the number '0'. +c) In a short comment, explain how the LIFO behavior of the stack guides the search to explore as deeply as possible along one path before backtracking. +*/ + + +// Helper function to check if a cell is within bounds and not visited +static bool IsValid(int aRow, int aCol) { + return aRow >= 0 && aRow < GRID_SIZE && aCol >= 0 && aCol < GRID_SIZE && !visited[aRow][aCol]; +} + +// The stack's LIFO behavior allows the DFS to explore one path fully before backtracking, ensuring that all possible routes are checked in depth-first order. +static bool DFS(int aStartRow, int aStartCol) { + TStackArray stack(GRID_SIZE * GRID_SIZE); + int cellPos = aStartRow * GRID_SIZE + aStartCol; // Encode 2D position as 1D + stack.Push(cellPos); + while (!stack.IsEmpty()) { + cellPos = stack.Pop(); + int row = cellPos / GRID_SIZE; + int col = cellPos % GRID_SIZE; + if (grid[row][col] == 0) { + std::cout << "Found 0 at (" << row << ", " << col << ")" << std::endl; + return true; + } + std::cout << "Visiting (" << row << ", " << col << ") with value " << grid[row][col] << std::endl; + visited[row][col] = true; + int neighbors[4][2] = { {row - 1, col}, {row, col + 1}, {row + 1, col}, {row, col - 1} }; + for (int i = 0; i < 4; i++) { + int newRow = neighbors[i][0]; + int newCol = neighbors[i][1]; + if (IsValid(newRow, newCol)) { + cellPos = newRow * GRID_SIZE + newCol; + stack.Push(cellPos); + } + } + } + std::cout << "0 not found in DFS" << std::endl; + return false; +} + +// The queue's FIFO behavior ensures that the BFS explores all neighbors at the present depth prior to moving on to nodes at the next depth level, effectively searching layer by layer. +static bool BFS(int aStartRow, int aStartCol) { + int row = aStartRow, col = aStartCol; + int pos = row * GRID_SIZE + col; // Encode 2D position as 1D + TQueueArray queue(GRID_SIZE * GRID_SIZE); + queue.Enqueue(pos); + while (!queue.IsEmpty()) { + pos = queue.Dequeue(); + row = pos / GRID_SIZE; + col = pos % GRID_SIZE; + if (grid[row][col] == 0) { + std::cout << "Found 0 at (" << row << ", " << col << ")" << std::endl; + return true; + } + std::cout << "Visiting (" << row << ", " << col << ") with value " << grid[row][col] << std::endl; + visited[row][col] = true; + int neighbors[4][2] = { {row - 1, col}, {row, col + 1},{row + 1, col},{row, col - 1} }; + for (int i = 0; i < 4; i++) { + row = neighbors[i][0]; + col = neighbors[i][1]; + if (IsValid(row, col)) { + pos = row * GRID_SIZE + col; + queue.Enqueue(pos); + } + } + } + std::cout << "0 not found in BFS" << std::endl; + return false; +} + + +int main() +{ + std::cout << "--- Submission 3: Stacks & Queues ---" << std::endl; + std::string original = "Hello, World!"; + std::string reversed = ReverseString(original.c_str()); + std::cout << "Original String: " << original << std::endl; + std::cout << "Reversed String: " << reversed << std::endl; + // The stack is the perfect tool for string reversal because it operates on a Last-In, First-Out (LIFO) principle. + // This means that the last character pushed onto the stack will be the first one to be popped off, effectively reversing the order of characters. + std::cout << "----------------------------------------------------" << std::endl << std::endl; + + std::cout << "Calculating Factorial of 5 using Stack:" << std::endl; + std::cout << "5! = " << Factorial(5) << std::endl; + std::cout << "----------------------------------------------------" << std::endl << std::endl; + + std::cout << "Simulating Wait Line using Queue:" << std::endl; + SimulateWaitLine(); + std::cout << "----------------------------------------------------" << std::endl << std::endl; + + std::cout << "Initializing 100x100 Grid and Performing DFS to find '0':" << std::endl; + InitializeGrid(); + int startRow = 3; //std::rand() % GRID_SIZE; + int startCol = 2; //std::rand() % GRID_SIZE; + std::cout << "Starting DFS from (" << startRow << ", " << startCol << ")" << std::endl; + DFS(startRow, startCol); + std::cout << std::endl << "Re-initializing visited array for BFS:" << std::endl; + for (int i = 0; i < GRID_SIZE; i++) { + for (int j = 0; j < GRID_SIZE; j++) { + visited[i][j] = false; // Reset visited array + } + } + std::cout << "Stating BFS from (" << startRow << ", " << startCol << ")" << std::endl; + BFS(startRow, startCol); // This should find a different path to '0' + std::cout << "----------------------------------------------------" << std::endl << std::endl; + + + return 0; +} diff --git a/Exam/IKT203Exam/Submissions/Submission-03/main.h b/Exam/IKT203Exam/Submissions/Submission-03/main.h new file mode 100644 index 0000000..ccf6e27 --- /dev/null +++ b/Exam/IKT203Exam/Submissions/Submission-03/main.h @@ -0,0 +1,8 @@ +// Submission-01.h : Include file for standard system include files, +// or project specific include files. + +#pragma once + +#include + +// TODO: Reference additional headers your program requires here. diff --git a/Exam/IKT203Exam/Submissions/Submission-04/BankAccount.cpp b/Exam/IKT203Exam/Submissions/Submission-04/BankAccount.cpp new file mode 100644 index 0000000..94bcf1e --- /dev/null +++ b/Exam/IKT203Exam/Submissions/Submission-04/BankAccount.cpp @@ -0,0 +1,108 @@ +#include "BankAccount.h" +#include +#include +#include +#include // For rand() +#include // For better random number generation +#include +#include // For memset +#include // For floor +#include // For time manipulation +#include // For locale settings +#include // For codecvt_utf8 +#include // For std::invalid_argument +#include + + +TBankAccount::TBankAccount(EBankAccountType accType, std::string firstName, std::string lastName) + : accountType(accType), ownerFirstName(firstName), ownerLastName(lastName) +{ + // Random genration of account number: XXXX.XX.XXXXX + accountNumber = toString(rand() % 9000 + 1000) + "." + toString(rand() % 90 + 10) + "." + toString(rand() % 90000 + 10000); + + balance = 0.0f; + + //Random generation of creation timestamp, date is any date and time in 2024 + int month = rand() % 12 + 1; + int day = rand() % 28 + 1; // To avoid complexity of different month lengths + int hour = rand() % 24; + int minute = rand() % 60; + + // Calculate creation timestamp in seconds from 2024-01-01 00:00:00 +std:tm tm = {}; + tm.tm_year = 2024 - 1900; // Year since 1900 + tm.tm_mon = rand() % 12; // Month [0-11] + tm.tm_mday = rand() % 28 + 1; // Day of the month [1-28] to avoid month length issues + tm.tm_hour = rand() % 24; // Hour [0-23] + tm.tm_min = rand() % 60; // Minute [0-59] + tm.tm_sec = 0; // Second [0-59] + creationTimestamp = _mkgmtime(&tm); // Use _mkgmtime for UTC + + if (accType == Checking || accType == Saving || accType == Pension) + balance = static_cast(rand() % 1001); // 0 to 1000 + else if (accType == Loan) + balance = static_cast(-(rand() % 25001 + 25000)); // -50000 to -25000 + else if (accType == Credit) + balance = static_cast(-(rand() % 1001)); // -1000 to 0 +} + +TBankAccount::~TBankAccount() +{ + // Destructor logic if needed +} + +std::string TBankAccount::getAccountNumber() const { + return accountNumber; +} + +EBankAccountType TBankAccount::getAccountType() const { + return accountType; +} + +time_t TBankAccount::getCreationTimestamp() const { + return creationTimestamp; +} +double TBankAccount::getBalance() const { + return balance; +} +void TBankAccount::deposit(double aAmount) { + if (aAmount > 0) balance += aAmount; +} + +void TBankAccount::withdraw(double aAmount) { + if (aAmount > 0 && aAmount <= balance) balance -= aAmount; +} + +std::string TBankAccount::getAccountTypeString() const +{ + switch (accountType) + { + case Checking: return "Checking"; + case Saving: return "Saving"; + case Credit: return "Credit"; + case Pension: return "Pension"; + case Loan: return "Loan"; + default: return "Unknown"; + } +} + +// +std::string TBankAccount::getCreationTimeString() const +{ + char buffer[26]; + ctime_s(buffer, sizeof(buffer), &creationTimestamp); + std::string timeString(buffer); + if (!timeString.empty() && timeString.back() == '\n') { + timeString.pop_back(); // Remove the trailing newline character + } + return timeString; +} + +void TBankAccount::printAccountInfo() const +{ + std::cout << "Account Number: " << accountNumber << ", Type: " << getAccountTypeString() + << ", Owner: " << ownerFirstName << " " << ownerLastName + << ", Balance: " << balance + << ", Created: " << getCreationTimeString() + << std::endl; +} \ No newline at end of file diff --git a/Exam/IKT203Exam/Submissions/Submission-04/BankAccount.h b/Exam/IKT203Exam/Submissions/Submission-04/BankAccount.h new file mode 100644 index 0000000..077b767 --- /dev/null +++ b/Exam/IKT203Exam/Submissions/Submission-04/BankAccount.h @@ -0,0 +1,52 @@ +#pragma once +#ifndef BANKACCOUNT_H +#define BANKACCOUNT_H + +#include // For std::string +#include // For time_t +#include // For rand() +#include // For std::setfill and std::setw +#include // For std::ostringstream +#include // For std::cout + + +// Helper function to convert value to string +template +std::string toString(T value) +{ + std::ostringstream oss; + oss << value; + return oss.str(); +} + + +enum EBankAccountType { Checking, Saving, Credit, Pension, Loan }; + +class TBankAccount { + +private: + std::string accountNumber; + EBankAccountType accountType; + time_t creationTimestamp; + double balance; + +public: + std::string ownerFirstName; + std::string ownerLastName; + + //TBankAccount() {} // Don't use default constructor + TBankAccount(EBankAccountType, std::string, std::string); + ~TBankAccount(); + + std::string getAccountNumber() const; + std::string getCreationTimeString() const; + time_t getCreationTimestamp() const; + double getBalance() const; + void deposit(double); + void withdraw(double); + EBankAccountType getAccountType() const; + std::string getAccountTypeString() const; + void printAccountInfo() const; +}; + +#endif // BANKACCOUNT_H \ No newline at end of file diff --git a/Exam/IKT203Exam/Submissions/Submission-04/BankAccountList.cpp b/Exam/IKT203Exam/Submissions/Submission-04/BankAccountList.cpp new file mode 100644 index 0000000..fb049d4 --- /dev/null +++ b/Exam/IKT203Exam/Submissions/Submission-04/BankAccountList.cpp @@ -0,0 +1,130 @@ +#include "BankAccountList.h" + +TLinkedList::TLinkedList(bool aOwnsData) : head(nullptr), ownsData(aOwnsData), size(0) { + head = new TLinkedListNode(nullptr); // Dummy head node +} + +TLinkedList::~TLinkedList() +{ + while (head->next != nullptr) + { + TLinkedListNode* temp = head->next; + head->next = temp->next; + if (ownsData) delete temp->data; // Delete the TBankAccount object + delete temp; // Delete the node + } + delete head; +} + +int TLinkedList::getSize() const { return size; } + +void TLinkedList::Add(TBankAccount* aData) +{ + TLinkedListNode* newNode = new TLinkedListNode(aData); + newNode->next = head->next; + head->next = newNode; + size++; +} + +TBankAccount* TLinkedList::Find(FCompareAccount aCompareFunc, void* aSearchKey) +{ + TLinkedListNode* current = head->next; + while (current != nullptr) + { + if (aCompareFunc(current->data, aSearchKey)) + { + return current->data; // Found + } + current = current->next; + } + return nullptr; // Not found +} + +TLinkedList* TLinkedList::Every(FCompareAccount aCompareFunc, void* aSearchKey) +{ + TLinkedList* resultList = new TLinkedList(false); // New list does not own data + TLinkedListNode* current = head->next; + while (current != nullptr) + { + if (aCompareFunc(current->data, aSearchKey)) + { + resultList->Add(current->data); // Add to result list + } + current = current->next; + } + return resultList; // Return the new list +} + +// Loop through all accounts, if aEveryFunc returns false for any, return that account +TBankAccount* TLinkedList::Every(FEveryAccount aEveryFunc) { + TLinkedListNode* current = head->next; + int index = 0; + while (current != nullptr) + { + if (!aEveryFunc(current->data, index++)) + { + return current->data; // Return the first account that fails the test + } + current = current->next; + } + return nullptr; // All accounts passed the test +} + +TBankAccount** TLinkedList::ToArray() +{ + if (size == 0) return nullptr; + TBankAccount** array = new TBankAccount * [size]; + TLinkedListNode* current = head->next; + int index = 0; + while (current != nullptr && index < size) // Ensure index < size + { + array[index++] = current->data; + current = current->next; + } + return array; +} + +void TLinkedList::forEach(FForEachAccount aFunc) +{ + TLinkedListNode* current = head->next; + int index = 0; + while (current != nullptr) + { + aFunc(current->data, index++); + current = current->next; + } +} + +TLinkedListNode* TLinkedList::getHead() const { return head; } + +void TLinkedList::Append(TBankAccount* account) +{ + TLinkedListNode* newNode = new TLinkedListNode(account); + TLinkedListNode* current = head; + while (current->next != nullptr) + { + current = current->next; + } + current->next = newNode; + size++; +} + +void TLinkedList::Remove(TBankAccount* account) +{ + TLinkedListNode* current = head; + while (current->next != nullptr) + { + if (current->next->data == account) + { + TLinkedListNode* temp = current->next; + current->next = temp->next; + if (ownsData) delete temp->data; // Delete the TBankAccount object + delete temp; // Delete the node + size--; + return; // Exit after removing + } + current = current->next; + } +} + + diff --git a/Exam/IKT203Exam/Submissions/Submission-04/BankAccountList.h b/Exam/IKT203Exam/Submissions/Submission-04/BankAccountList.h new file mode 100644 index 0000000..2b6d7df --- /dev/null +++ b/Exam/IKT203Exam/Submissions/Submission-04/BankAccountList.h @@ -0,0 +1,51 @@ +#pragma once +#ifndef BANKACCOUNTLIST_H +#define BANKACCOUNTLIST_H +#include "BankAccount.h" +#include +#include + +typedef bool (*FCompareAccount)(TBankAccount* account, void* searchKey); +typedef void (*FForEachAccount)(TBankAccount* account, int index); +typedef bool (*FEveryAccount)(TBankAccount*, int); + +// Node class for linked list +class TLinkedListNode +{ +public: + TBankAccount* data; + TLinkedListNode* next; + TLinkedListNode(TBankAccount* aData) : data(aData), next(nullptr) {} + ~TLinkedListNode() + { + // Destructor logic if needed + } +}; + +// Use dummy head node for simplicity +class TLinkedList +{ +private: + TLinkedListNode* head; + bool ownsData; + int size; +public: + TLinkedList(bool); + ~TLinkedList(); + int getSize() const; + TLinkedListNode* getHead() const; + + void Add(TBankAccount*); + + TBankAccount* Find(FCompareAccount, void*); + + TLinkedList* Every(FCompareAccount, void*); + TBankAccount* Every(FEveryAccount aEveryFunc); + TBankAccount** ToArray(); + void forEach(FForEachAccount); + + void Append(TBankAccount* account); + void Remove(TBankAccount* account); +}; + +#endif// BANKACCOUNTLIST_H \ No newline at end of file diff --git a/Exam/IKT203Exam/Submissions/Submission-04/CMakeLists.txt b/Exam/IKT203Exam/Submissions/Submission-04/CMakeLists.txt new file mode 100644 index 0000000..01fc28e --- /dev/null +++ b/Exam/IKT203Exam/Submissions/Submission-04/CMakeLists.txt @@ -0,0 +1,25 @@ +# CMakeList.txt : CMake project for Submission-01, include source and define +# project specific logic here. +# + +# Add source to this project's executable. +add_executable (Submission-04 "main.cpp" "main.h" "BankAccount.h" "ReadNames.cpp" "ReadNames.h" "BankAccount.cpp" "BankAccount.h" "BankAccountList.cpp" "BankAccountList.h") +target_link_libraries(Submission-04 PRIVATE LibExample) + +# Add source files to a Submission04Lib library +add_library(Submission04Lib + BankAccount.cpp + BankAccount.h + ReadNames.cpp + ReadNames.h + BankAccountList.cpp + BankAccountList.h +) + +target_include_directories(Submission04Lib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + +if (CMAKE_VERSION VERSION_GREATER 3.20) + set_property(TARGET Submission-03 PROPERTY CXX_STANDARD 20) +endif() + +# TODO: Add tests and install targets if needed. diff --git a/Exam/IKT203Exam/Submissions/Submission-04/ReadNames.cpp b/Exam/IKT203Exam/Submissions/Submission-04/ReadNames.cpp new file mode 100644 index 0000000..0b6d01f --- /dev/null +++ b/Exam/IKT203Exam/Submissions/Submission-04/ReadNames.cpp @@ -0,0 +1,31 @@ +#include +#include +#include +#include +#include "ReadNames.h" + +void readNamesFromFile(const std::string& aFilename, FNameRead aOnNameRead) +{ + if (aFilename.empty()) return; + std::ifstream file(aFilename); + if (!file.is_open()) + { + std::cerr << "Error opening file: " << aFilename << std::endl; + return; + } + std::string line; + while (std::getline(file, line)) + { + std::istringstream iss(line); + std::string firstName, lastName; + if (iss >> firstName >> lastName) + { + if (aOnNameRead) // If the callback is set, call it + { + //If the function returns false, stop reading further + if (!aOnNameRead(firstName, lastName)) break; + } + } + } + file.close(); +} diff --git a/Exam/IKT203Exam/Submissions/Submission-04/ReadNames.h b/Exam/IKT203Exam/Submissions/Submission-04/ReadNames.h new file mode 100644 index 0000000..b1428b5 --- /dev/null +++ b/Exam/IKT203Exam/Submissions/Submission-04/ReadNames.h @@ -0,0 +1,30 @@ +#pragma once +#ifndef READNAMES_H +#define SHARED_LIB_H +#include +#include + +/// +/// Use this delegate type to define a callback function for processing names read from a file. +/// +/// FNameRead +/// A function pointer type for a callback that processes names read from a file. +/// The first name read from the file. +/// The last name read from the file. +/// Returns true to continue reading names, or false to stop. +typedef bool (*FNameRead)(const std::string& firstName, const std::string& lastName); + +/// +/// Use this function to read names from a specified file and process them using a callback function. +/// +/// readNamesFromFile +/// Reads names from a specified file and invokes a callback for each name read. +/// The path to the file containing names. +/// A callback function that is called for each name read. It takes two parameters: firstName and lastName. If the callback returns false, the reading process stops. +/// The first name read from the file. +/// The last name read from the file. +/// None. +void readNamesFromFile(const std::string& aFilename, FNameRead aOnNameRead); + + +#endif // READNAMES_H \ No newline at end of file diff --git a/Exam/IKT203Exam/Submissions/Submission-04/main.cpp b/Exam/IKT203Exam/Submissions/Submission-04/main.cpp new file mode 100644 index 0000000..71f0f90 --- /dev/null +++ b/Exam/IKT203Exam/Submissions/Submission-04/main.cpp @@ -0,0 +1,180 @@ +// Submission-01.cpp : Defines the entry point for the application. +// + +#include "main.h" +#include "ReadNames.h" // For reading names from file +#include "BankAccount.h" // For TBankAccount and EBankAccountType +#include "BankAccountList.h" // For TLinkedList +#include // For std::getline and std::string +#include // For std::cout +#include // For std::istringstream + + + +// For statistics +typedef struct _TSummary { + long comparisonCount = 0; + double timeTaken = 0.0; +}TSummary; +static TSummary statistics; + + + +static EBankAccountType getRandomAccountType() +{ + return static_cast(rand() % 5); // Randomly returns one of the 5 account types +} + +TLinkedList* bankAccounts = new TLinkedList(true); // List owns the TBankAccount objects +TBankAccount** bankAccountArray = nullptr; + + +static bool OnNameRead(const std::string& firstName, const std::string& lastName) +{ + //For each name read, create from 5 to 10 random bank accounts + int accountCount = rand() % 6 + 5; // Random number between 5 and 10 + for (int i = 0; i < accountCount; i++) + { + EBankAccountType accType = getRandomAccountType(); + TBankAccount* newAccount = new TBankAccount(accType, firstName, lastName); + bankAccounts->Add(newAccount); + } + return true; //bankAccounts->getSize() < 100; // For demo purposes +} + +static void resetStatistics() +{ + statistics.comparisonCount = 0; + statistics.timeTaken = (static_cast(clock())) / CLOCKS_PER_SEC; +} + +static void printStastics() { + statistics.timeTaken = (static_cast(clock())) / CLOCKS_PER_SEC - statistics.timeTaken; + std::cout << "Comparisons: " << statistics.comparisonCount << ", Time taken: " << statistics.timeTaken << " seconds." << std::endl; +} + +/* +Part 3: Standalone Search Functions (The External Analyst) +To simulate working with data from different perspectives, you will also implement search functions that are not part of the list class. These functions will operate on a simple array of pointers. +*/ + +static TBankAccount* FindAccountByNumber(TBankAccount** accountArray, int arraySize, const std::string& accountNumber) { + if (accountArray == nullptr || arraySize <= 0) return nullptr; + for (int i = 0; i < arraySize; i++) { + statistics.comparisonCount++; + if (accountArray[i]->getAccountNumber() == accountNumber) { + return accountArray[i]; // Found + } + } + return nullptr; // Not found +} + +static void PrintEveryAccountInDateRange(TBankAccount** accountArray, int arraySize, time_t from, time_t to) { + if (accountArray == nullptr || arraySize <= 0) return; + std::cout << "------------------------------" << std::endl; + resetStatistics(); + int foundCount = 0; + for (int i = 0; i < arraySize; i++) { + statistics.comparisonCount++; + time_t ts = accountArray[i]->getCreationTimestamp(); + if (ts >= from && ts < to) { + std::cout << i + 1 << ". "; + accountArray[i]->printAccountInfo(); + foundCount++; + } + } + printStastics(); + std::cout << "Total accounts found in date range: " << foundCount << std::endl; +} + + +int main() +{ + std::cout << "--- Submission 4: Sosrt & Search ---" << std::endl; + + // Test TBankAccount + //Gen random account type + //Change this name for you own names file + std::string namesFile = "F:\\IKT203\\VisualStudio\\DATA\\Random_Name.txt"; + std::cout << "Reading names from file: " << namesFile << std::endl; + readNamesFromFile(namesFile, OnNameRead); + std::cout << "Total Bank Accounts Created: " << bankAccounts->getSize() << std::endl; + std::cout << "Converting linked list to array..." << std::endl; + bankAccountArray = bankAccounts->ToArray(); + std::cout << "Array created with " << bankAccounts->getSize() << " accounts." << std::endl; + + + resetStatistics(); + int getRandomIndex = rand() % bankAccounts->getSize(); + TBankAccount* foundAccount = FindAccountByNumber(bankAccountArray, bankAccounts->getSize(), bankAccountArray[getRandomIndex]->getAccountNumber()); + if (foundAccount) + { + std::cout << "Found Account: " << std::endl; + foundAccount->printAccountInfo(); + } + else + { + std::cout << "Account not found." << std::endl; + } + printStastics(); + + resetStatistics(); + foundAccount = FindAccountByNumber(bankAccountArray, bankAccounts->getSize(), "1234.56.78901"); + if (foundAccount) + { + std::cout << "Found Account: " << std::endl; + foundAccount->printAccountInfo(); + } + else + { + std::cout << "Account not found." << std::endl; + } + printStastics(); + + // Find All (Integrated): Use your Every() method to find all accounts created in June 2024 and print their details. + resetStatistics(); + struct June2024Key { + time_t start; + time_t end; + }; + June2024Key juneKey{}; + std::tm fromToTm = {}; + fromToTm.tm_year = 2024 - 1900; // Year since 1900 + fromToTm.tm_mon = 5; // June (0-based) + fromToTm.tm_mday = 1; // 1st + fromToTm.tm_hour = 0; + fromToTm.tm_min = 0; + fromToTm.tm_sec = 0; + juneKey.start = _mkgmtime(&fromToTm); // Use _mkgmtime for UTC + fromToTm.tm_mday = 30; // 30th + fromToTm.tm_hour = 23; + fromToTm.tm_min = 59; + fromToTm.tm_sec = 59; + juneKey.end = _mkgmtime(&fromToTm); // Use _mkgmtime for UTC + + TLinkedList* juneAccounts = bankAccounts->Every( + [](TBankAccount* account, void* searchKey) -> bool { + June2024Key* key = static_cast(searchKey); + time_t ts = account->getCreationTimestamp(); + return ts >= key->start && ts < key->end; + }, &juneKey); + + std::cout << "Accounts created in June 2024: " << juneAccounts->getSize() << std::endl; + printStastics(); + + juneAccounts->forEach( + [](TBankAccount* aAccount, int aIndex) { + std::cout << aIndex + 1 << ". "; + aAccount->printAccountInfo(); + }); + + PrintEveryAccountInDateRange(bankAccountArray, bankAccounts->getSize(), juneKey.start, juneKey.end); + + + // Cleanup + // First delete the array, then the linked list + delete[] bankAccountArray; + delete bankAccounts; + + return 0; +} diff --git a/Exam/IKT203Exam/Submissions/Submission-04/main.h b/Exam/IKT203Exam/Submissions/Submission-04/main.h new file mode 100644 index 0000000..ccf6e27 --- /dev/null +++ b/Exam/IKT203Exam/Submissions/Submission-04/main.h @@ -0,0 +1,8 @@ +// Submission-01.h : Include file for standard system include files, +// or project specific include files. + +#pragma once + +#include + +// TODO: Reference additional headers your program requires here. diff --git a/Exam/IKT203Exam/Submissions/Submission-05/CMakeLists.txt b/Exam/IKT203Exam/Submissions/Submission-05/CMakeLists.txt new file mode 100644 index 0000000..ba0a700 --- /dev/null +++ b/Exam/IKT203Exam/Submissions/Submission-05/CMakeLists.txt @@ -0,0 +1,13 @@ +# CMakeList.txt : CMake project for Submission-01, include source and define +# project specific logic here. +# + +# Add source to this project's executable. +add_executable (Submission-05 "main.cpp" "main.h") +target_link_libraries(Submission-05 PRIVATE Submission04Lib LibExample) + +if (CMAKE_VERSION VERSION_GREATER 3.20) + set_property(TARGET Submission-05 PROPERTY CXX_STANDARD 20) +endif() + +# TODO: Add tests and install targets if needed. diff --git a/Exam/IKT203Exam/Submissions/Submission-05/main.cpp b/Exam/IKT203Exam/Submissions/Submission-05/main.cpp new file mode 100644 index 0000000..56cd8c2 --- /dev/null +++ b/Exam/IKT203Exam/Submissions/Submission-05/main.cpp @@ -0,0 +1,828 @@ +// Submission-01.cpp : Defines the entry point for the application. +// + +#include "ReadNames.h" // For reading names from file +#include "BankAccount.h" // For TBankAccount and EBankAccountType +#include "BankAccountList.h" // For TLinkedList +#include // For std::getline and std::string +#include // For std::cout +#include // For std::istringstream + + + +// For statistics +typedef struct _TSummary { + long long comparisonCount = 0; + long long swaps = 0; + double timeTaken = 0.0; +}TSummary; +static TSummary statistics; + + +static void resetStatistics() +{ + statistics.comparisonCount = 0; + statistics.swaps = 0; + statistics.timeTaken = (static_cast(clock())) / CLOCKS_PER_SEC; +} + +static void printStastics() { + statistics.timeTaken = (static_cast(clock())) / CLOCKS_PER_SEC - statistics.timeTaken; + std::cout << "Comparisons: " << statistics.comparisonCount << ", Swaps: " << statistics.swaps << ", Time taken : " << statistics.timeTaken << " seconds." << std::endl; +} + + +static EBankAccountType getRandomAccountType() +{ + return static_cast(rand() % 5); // Randomly returns one of the 5 account types +} + +TLinkedList* bankAccounts = new TLinkedList(true); // List owns the TBankAccount objects +TBankAccount** bankAccountArray = nullptr; + + +static bool OnNameRead(const std::string& firstName, const std::string& lastName) +{ + //For each name read, create from 5 to 10 random bank accounts + int accountCount = rand() % 6 + 5; // Random number between 5 and 10 + for (int i = 0; i < accountCount; i++) + { + EBankAccountType accType = getRandomAccountType(); + TBankAccount* newAccount = new TBankAccount(accType, firstName, lastName); + bankAccounts->Add(newAccount); + } + return bankAccounts->getSize() < 2500; // For demo purposes +} + +/* +Part 1: The Sorting Toolkit +Before we can sort, we need the right tools. In this part, you'll set up a flexible, powerful sorting "engine" that can handle any sorting criteria we give it. + +1. The FCompareAccounts Callback: + a) Create a typedef for a function pointer named FCompareAccounts. + b) The signature must be: int (*FCompareAccounts)(TBankAccount* a, TBankAccount* b);. + c) This function should return a negative value if a comes before b, zero if they are equal, and a positive value if a comes after b. +2. The OperationSummary Struct: + a) Create a struct named OperationSummary to track performance metrics: long long comparisons, long long swaps, and double timeSpentMs. +3. The TSort Class: + a) Create a class called TSort. This will be your dedicated sorting engine. + b) The constructor should take pointers to the original data sources (the list and the array). + c) The sorting methods should create and return a new, sorted array or list, not modify the original. +*/ + +/* +Part 2: The Simple Sorts (O(n²)) - Foundational, but Slow +These algorithms are your first step. They are conceptually simpler but do not perform well on large datasets. Implementing them is essential for understanding the fundamentals. + +4. Selection Sort: + a) The Challenge: You must implement this algorithm twice in your TSort class: + 1. A version that sorts the pointer array. + 2. A version that sorts the linked list. + b) Pay close attention to the pointer manipulation required for the linked list version—it's a fantastic challenge! +5. Bubble Sort: + a) Implement a method in TSort that performs a Bubble Sort on the pointer array. + + +Part 3: The Advanced Sorts (O(n log n)) - Divide and Conquer +Now for the heavy hitters. These recursive, "Divide and Conquer" algorithms are far more efficient and are staples of modern software engineering. + +6. Quick Sort (on the Array): + a) Implement Quick Sort to sort the pointer array. + b) Your implementation must use the public/private recursion pattern. A public QuickSort() method calls a private QuickSortRecursive(...). + c) The heart of this algorithm is the Partition() helper function. Getting this right is the key to success! + +7. Merge Sort (on the Linked List): + a) Implement Merge Sort to sort the linked list. This algorithm is a natural fit for list structures. + b) This implementation must also use the public/private recursion pattern. + c) Hint: For splitting the linked list, research the "fast and slow pointer" technique. + +Part 4: The Great Sort-Off +It's time for a performance battle! You will use your TSort engine to sort the same large dataset with all your implemented algorithms and analyze the results. + +8. Callback Implementations: + a) Write at least two different FCompareAccounts callback functions: one to sort by last name, and one to sort by balance. + +9. The Performance Battle: + a) Using your dataset of 5,000+ accounts, run all four of your sorting algorithms using the same callback function for a fair comparison. + b) For each run, capture the OperationSummary (comparisons, swaps, time). + +10. Analysis in Your Report: + a) Present your performance data in a clear table. + b) Write a paragraph answering: How do the results illustrate the difference between O(n²) and O(n log n) complexity? Why was Selection Sort harder on a list versus an array? + +Part 5: The Payoff - Integrated Binary Search + +11. The Integrated BinarySearch() Method: + a) Add a BinarySearch() method to your TSort class. This method will operate on a sorted array. + b) The TSort class must now manage an internal state (e.g., a private pointer to a sorted array and a boolean flag). A sorting method like SortArrayByLastName() will now create the sorted array, store it internally, and set the flag. + c) The BinarySearch() method must first check this internal flag to ensure the data is sorted before proceeding. + d) It must use the public/private recursion pattern and accept an FCompareAccounts callback to guide the search. + +12. Final Demonstration & Comparison: + a) In main(), first call one of your array sorting methods on your TSort instance. Then, use its new BinarySearch() method to find an item. + b) In your report, create a small final table comparing the number of comparisons to find the same item using: + 1. The Linear Search from Submission 4. + 2. The Binary Search from this submission. + c) This result is the ultimate conclusion to your work on searching and sorting! +*/ + + +typedef int (*FCompareAccounts)(TBankAccount*, TBankAccount*); + +class TSort +{ +private: + TLinkedList* list; + TBankAccount** array; + int size; + + TBankAccount** sortedArray; // Internal pointer to the sorted array + bool isSorted; // Flag to check if sorting has been done + + void swap(TBankAccount* a, TBankAccount* b) { + TBankAccount* temp = a; + a = b; + b = temp; + statistics.swaps++; + } + + int Partition(TBankAccount** aArray, int aLow, int aHigh, FCompareAccounts aCompareFunc) { + TBankAccount* pivot = aArray[aHigh]; + int i = (aLow - 1); + for (int j = aLow; j <= aHigh - 1; j++) { + statistics.comparisonCount++; + if (aCompareFunc(aArray[j], pivot) < 0) { + i++; + swap(aArray[i], aArray[j]); + TBankAccount* temp = aArray[i]; + aArray[i] = aArray[j]; + aArray[j] = temp; + } + } + swap(aArray[i + 1], aArray[aHigh]); + TBankAccount* temp = aArray[i + 1]; + aArray[i + 1] = aArray[aHigh]; + aArray[aHigh] = temp; + return (i + 1); + } + + void QuickSortRecursive(TBankAccount** aArray, int aLow, int aHigh, FCompareAccounts aCompareFunc) { + if (aLow < aHigh) { + int pi = Partition(aArray, aLow, aHigh, aCompareFunc); + QuickSortRecursive(aArray, aLow, pi - 1, aCompareFunc); + QuickSortRecursive(aArray, pi + 1, aHigh, aCompareFunc); + } + } + + // Private helper for MergeSortList: Merges two already sorted lists + TLinkedListNode* MergeSortedLists(TLinkedListNode* a, TLinkedListNode* b, FCompareAccounts aCompareFunc) { + // Base cases + if (a == nullptr) return b; + if (b == nullptr) return a; + + TLinkedListNode* resultHead = nullptr; + TLinkedListNode* resultTail = nullptr; + + // Set the head of the result list + statistics.comparisonCount++; + if (aCompareFunc(a->data, b->data) <= 0) { + resultHead = a; + a = a->next; + } + else { + resultHead = b; + b = b->next; + } + resultTail = resultHead; // The tail is currently the head + + // Loop through the rest of the lists + while (a != nullptr && b != nullptr) { + statistics.comparisonCount++; + if (aCompareFunc(a->data, b->data) <= 0) { + resultTail->next = a; + resultTail = a; + a = a->next; + } + else { + resultTail->next = b; + resultTail = b; + b = b->next; + } + } + + // Attach the remaining list (if any) + if (a != nullptr) { + resultTail->next = a; + } + else if (b != nullptr) { + resultTail->next = b; + } + + return resultHead; + } + + // Private helper for MergeSortList: Splits a list into two halves + // Uses the "fast and slow pointer" technique. + // 'source' is the head of the list to split. + // Returns the head of the second half. 'source' is modified to be the first half. + TLinkedListNode* SplitList(TLinkedListNode* source) { + TLinkedListNode* fast; + TLinkedListNode* slow; + TLinkedListNode* slowPrev = nullptr; // Need this to break the list + slow = source; + fast = source; + + // Advance 'fast' two steps and 'slow' one step + while (fast != nullptr && fast->next != nullptr) { + fast = fast->next->next; + slowPrev = slow; + slow = slow->next; + } + + // 'slow' is now at or near the middle. + // Split the list in two by setting the end of the first list to null. + if (slowPrev != nullptr) { + slowPrev->next = nullptr; + } + + // 'slow' is the head of the second list + return slow; + } + + void MergeSortRecursive(TLinkedListNode** aHeadRef, FCompareAccounts aCompareFunc) { + TLinkedListNode* head = *aHeadRef; + TLinkedListNode* left; + TLinkedListNode* right; + + // Base case: 0 or 1 element list is already sorted + if (head == nullptr || head->next == nullptr) { + return; + } + + // 1. Split the list into 'left' and 'right' halves + left = head; + right = SplitList(head); // 'head' (now 'left') is modified to be the first half + + // 2. Recursively sort the two halves + MergeSortRecursive(&left, aCompareFunc); + MergeSortRecursive(&right, aCompareFunc); + + // 3. Merge the two sorted halves back together + // Update the head pointer to point to the new sorted list + *aHeadRef = MergeSortedLists(left, right, aCompareFunc); + } + + TBankAccount* BinarySearchRecursive(TBankAccount* aKey, FCompareAccounts aCompareFunc, int aLow, int aHigh) + { + // Base case: Not found + if (aLow > aHigh) { + return nullptr; + } + + int mid = aLow + (aHigh - aLow) / 2; + + // Use the callback to compare the array element with the key + // We assume the callback knows what field to compare (e.g., lastName) + statistics.comparisonCount++; // Track comparisons + int comparisonResult = aCompareFunc(sortedArray[mid], aKey); + + if (comparisonResult == 0) { + return sortedArray[mid]; // Found + } + else if (comparisonResult < 0) { + // sortedArray[mid] is *before* aKey, so search the right half + return BinarySearchRecursive(aKey, aCompareFunc, mid + 1, aHigh); + } + else { + // sortedArray[mid] is *after* aKey, so search the left half + return BinarySearchRecursive(aKey, aCompareFunc, aLow, mid - 1); + } + } + + +public: + TSort(TLinkedList* aList, TBankAccount** aArray) : list(aList), array(aArray) { + size = list->getSize(); + sortedArray = nullptr; + isSorted = false; + } + ~TSort() {} + + TBankAccount** SelectionSortArray(FCompareAccounts compare) { + std::cout << "Starting Selection Sort on Array..." << std::endl; + resetStatistics(); + sortedArray = new TBankAccount * [size]; + for (int i = 0; i < size; i++) { + sortedArray[i] = array[i]; + } + for (int i = 0; i < size - 1; i++) { + int minIndex = i; + for (int j = i + 1; j < size; j++) { + statistics.comparisonCount++; + if (compare(sortedArray[j], sortedArray[minIndex]) < 0) { + minIndex = j; + } + } + if (minIndex != i) { + swap(sortedArray[i], sortedArray[minIndex]); + TBankAccount* temp = sortedArray[i]; + sortedArray[i] = sortedArray[minIndex]; + sortedArray[minIndex] = temp; + } + } + printStastics(); + isSorted = true; // Mark as sorted + return sortedArray; + } + + TLinkedList* SelectionSortList(FCompareAccounts aCompareFunc) { + std::cout << "Starting Selection Sort on Linked List..." << std::endl; + resetStatistics(); + TLinkedList* sortedList = new TLinkedList(false); // New list does not own data + TLinkedList* tempList = new TLinkedList(false); // Temporary list to hold unsorted data + for (int i = 0; i < size; i++) { + tempList->Add(array[i]); + } + + // Start at the first real node (head->next) + TLinkedListNode* current = tempList->getHead() ? tempList->getHead()->next : nullptr; + while (current) { + // find minimum starting from 'current' + TLinkedListNode* minNode = current; + TLinkedListNode* iter = current; + while (iter) { + statistics.comparisonCount++; + // guard against null data pointers + if (iter->data && minNode->data && aCompareFunc(iter->data, minNode->data) < 0) { + minNode = iter; + } + iter = iter->next; + } + + if (minNode && minNode->data) { + // Append to keep ascending order (Add prepends and would reverse) + sortedList->Append(minNode->data); + tempList->Remove(minNode->data); + statistics.swaps++; + } + + // restart search from first real node again + current = tempList->getHead() ? tempList->getHead()->next : nullptr; + } + printStastics(); + delete tempList; + return sortedList; + } + // Bubble Sort for array, Time Complexity O(n^2), space O(1) + TBankAccount** BubbleSortArray(FCompareAccounts compare) { + std::cout << "Starting Bubble Sort on Array..." << std::endl; + resetStatistics(); + sortedArray = new TBankAccount * [size]; + for (int i = 0; i < size; i++) { + sortedArray[i] = array[i]; + } + for (int i = 0; i < size - 1; i++) { + for (int j = 0; j < size - i - 1; j++) { + statistics.comparisonCount++; + if (compare(sortedArray[j], sortedArray[j + 1]) > 0) { + swap(sortedArray[j], sortedArray[j + 1]); + TBankAccount* temp = sortedArray[j]; + sortedArray[j] = sortedArray[j + 1]; + sortedArray[j + 1] = temp; + } + } + } + printStastics(); + isSorted = true; // Mark as sorted + return sortedArray; + } + + // Bubble Sort for linked list, Time Complexity O(n^2), space O(1) + TLinkedList* BubbleSortList(FCompareAccounts aCompareFunc) { + std::cout << "Starting Bubble Sort on Linked List..." << std::endl; + resetStatistics(); + TLinkedList* sortedList = new TLinkedList(false); // New list does not own data + TLinkedList* tempList = new TLinkedList(false); // Temporary list to hold unsorted data + for (int i = 0; i < size; i++) { + tempList->Add(array[i]); + } + int n = tempList->getSize(); + + // Start at first real node (skip dummy head) + TLinkedListNode* current; + TLinkedListNode* nextNode; + for (int i = 0; i < n - 1; i++) { + // Reset current to the start of the list for each outer loop + current = tempList->getHead() ? tempList->getHead()->next : nullptr; + nextNode = current ? current->next : nullptr; + for (int j = 0; j < n - i - 1; j++) { + if (!current || !nextNode) break; + statistics.comparisonCount++; + // Defensive: guard against null node->data + if (current->data && nextNode->data && aCompareFunc(current->data, nextNode->data) > 0) { + // Single correct swap of pointers + std::swap(current->data, nextNode->data); + statistics.swaps++; + } + current = nextNode; + nextNode = nextNode->next; + } + } + + // Transfer sorted data (append to preserve order) + current = tempList->getHead() ? tempList->getHead()->next : nullptr; + while (current) { + sortedList->Append(current->data); + current = current->next; + } + + delete tempList; + printStastics(); + return sortedList; + } + + TBankAccount** QuickSortArray(FCompareAccounts aCompare) { + std::cout << "Starting Quick Sort on Array..." << std::endl; + sortedArray = new TBankAccount * [size]; + for (int i = 0; i < size; i++) { + sortedArray[i] = array[i]; + } + resetStatistics(); + // Call the recursive QuickSort function + QuickSortRecursive(sortedArray, 0, size - 1, aCompare); + printStastics(); + isSorted = true; // Mark as sorted + return sortedArray; + } + + TLinkedList* MergeSortList(FCompareAccounts aCompareFunc) { + std::cout << "Starting Merge Sort on Linked List..." << std::endl; + resetStatistics(); // Resets comparisons, swaps, and starts timer + + // 1. Create the new list that we will sort and return. + // It does not own the TBankAccount data. + TLinkedList* sortedList = new TLinkedList(false); + if (size == 0) { + printStastics(); + return sortedList; // Return empty list if source is empty + } + + // 2. Populate 'sortedList' with the data from the array. + // We use 'Add' (prepend) for consistency with your other list sort methods. + // The initial order doesn't matter, as we're sorting the whole set. + for (int i = 0; i < size; i++) { + sortedList->Add(array[i]); + } + + // 3. Get the address of the *real* head pointer (head->next). + // The list uses a dummy head, so sorting starts at 'head->next'. + // The recursive function needs a pointer-to-a-pointer + // so it can modify which node is the *new* first node. + TLinkedListNode** realHeadPtr = &(sortedList->getHead()->next); + + // 4. Call the recursive sort. + // This will sort the list 'in-place' by rearranging node pointers. + MergeSortRecursive(realHeadPtr, aCompareFunc); + + // 5. Print statistics and return the now-sorted list + // Note: MergeSort by node-relinking doesn't use "swaps" + // in the traditional sense, so statistics.swaps should be 0. + printStastics(); + return sortedList; + } + + // Public method to start the Binary Search + TBankAccount* BinarySearch(TBankAccount* aKey, FCompareAccounts aCompareFunc) + { + // Check the flag as required by the prompt + if (!isSorted || sortedArray == nullptr) { + std::cout << "Error: Cannot binary search. Array is not sorted." << std::endl; + std::cout << "Please call an array-sorting method (e.g., QuickSortArray) first." << std::endl; + return nullptr; + } + + std::cout << "Starting Binary Search..." << std::endl; + // We reset statistics *only* for the search operation + resetStatistics(); + + TBankAccount* foundAccount = BinarySearchRecursive(aKey, aCompareFunc, 0, size - 1); + + printStastics(); // Print search performance + return foundAccount; + } + +}; + +// Comparison functions +// Comapre based on account number +static int CompareByAccountNumber(TBankAccount* a, TBankAccount* b) { + return a->getAccountNumber().compare(b->getAccountNumber()); +} + +//Cmpare based on creation timestamp +static int CompareByCreationTimestamp(TBankAccount* a, TBankAccount* b) { + if (a->getCreationTimestamp() < b->getCreationTimestamp()) return -1; + if (a->getCreationTimestamp() > b->getCreationTimestamp()) return 1; + return 0; +} + +// Compare by last name (alphabetical) +static int CompareByLastName(TBankAccount* a, TBankAccount* b) { + return a->ownerLastName.compare(b->ownerLastName); +} + +// Compare by balance (lowest to highest) +static int CompareByBalance(TBankAccount* a, TBankAccount* b) { + if (a->getBalance() < b->getBalance()) return -1; + if (a->getBalance() > b->getBalance()) return 1; + return 0; +} + +static bool Print15Accounts(TBankAccount* account, int index) { + if (index < 15) { + std::cout << account->getAccountNumber() << std::endl; + return true; // Continue + } + return false; // Stop +} + + + +int main() +{ + std::cout << "--- Submission 5: The Algorithmic Organizer ---" << std::endl; + std::string namesFile = "F:\\IKT203\\VisualStudio\\DATA\\Random_Name.txt"; + std::cout << "Reading names from file: " << namesFile << std::endl; + readNamesFromFile(namesFile, OnNameRead); + std::cout << "Total Bank Accounts Created: " << bankAccounts->getSize() << std::endl; + std::cout << "Converting linked list to array..." << std::endl; + bankAccountArray = bankAccounts->ToArray(); + std::cout << "Array created with " << bankAccounts->getSize() << " accounts." << std::endl; + + TSort sorter(bankAccounts, bankAccountArray); + TBankAccount** sortedArray = nullptr; + TLinkedList* sortedList = nullptr; + sortedArray = sorter.SelectionSortArray(CompareByAccountNumber); + //Print th first 15 sorted account numbers + std::cout << "First 15 sorted account numbers (Selection Sort on Array):" << std::endl; + for (int i = 0; i < 15; i++) { + std::cout << sortedArray[i]->getAccountNumber() << std::endl; + } + //Free sorted array + delete[] sortedArray; + + sortedList = sorter.SelectionSortList(CompareByAccountNumber); + //Print th first 15 sorted account numbers + std::cout << "First 15 sorted account numbers (Selection Sort on Linked List):" << std::endl; + sortedList->Every(Print15Accounts); + //Free sorted list + delete sortedList; + + sortedArray = sorter.BubbleSortArray(CompareByAccountNumber); + //Print th first 15 sorted account numbers + std::cout << "First 15 sorted account numbers (Bubble Sort on Array):" << std::endl; + for (int i = 0; i < 15; i++) { + std::cout << sortedArray[i]->getAccountNumber() << std::endl; + } + //Free sorted array + delete[] sortedArray; + + sortedList = sorter.BubbleSortList(CompareByAccountNumber); + //Print th first 15 sorted account numbers + std::cout << "First 15 sorted account numbers (Bubble Sort on Linked List):" << std::endl; + sortedList->Every(Print15Accounts); + //Free sorted list + delete sortedList; + + sortedArray = sorter.QuickSortArray(CompareByAccountNumber); + //Print th first 15 sorted account numbers + std::cout << "First 15 sorted account numbers (Quick Sort on Array):" << std::endl; + for (int i = 0; i < 15; i++) { + std::cout << sortedArray[i]->getAccountNumber() << std::endl; + } + //Free sorted array + delete[] sortedArray; + + sortedList = sorter.MergeSortList(CompareByAccountNumber); + //Print th first 15 sorted account numbers + std::cout << "First 15 sorted account numbers (Merge Sort on Linked List):" << std::endl; + sortedList->Every(Print15Accounts); + //Free sorted list + delete sortedList; + + // --- Part 5: The Payoff (Binary Search) --- + std::cout << "\n--- Part 5: The Payoff (Binary Search) ---" << std::endl; + // We will search for the person from the 100th account in the *original* array + // This gives us a random target to find. + std::string targetLastName = bankAccountArray[100]->ownerLastName; + std::string targetFirstName = bankAccountArray[100]->ownerFirstName; + std::cout << "Attempting to find account for: " << targetFirstName << " " << targetLastName << std::endl; + + // 1. Create a "dummy" key object. + // We only need to fill in the field we are comparing against (lastName). + // We pass 0 (Checking) as a placeholder. + TBankAccount* searchKey = new TBankAccount(Checking, "", targetLastName); + + // 2. First, we must sort the array by last name to prepare for binary search. + sortedArray = sorter.QuickSortArray(CompareByLastName); + + // 2. Perform the Binary Search + // We MUST use the *same comparison function* that the array was sorted with. + TBankAccount* foundAccount = sorter.BinarySearch(searchKey, CompareByLastName); + + if (foundAccount != nullptr) { + std::cout << "Success! Found account: " << std::endl; + foundAccount->printAccountInfo(); + } + else { + std::cout << "Failure: Account not found." << std::endl; + } + + // 3. Clean up the dummy key + delete searchKey; + // Clean up the sorted array + delete[] sortedArray; + + + // Cleanup + // First delete the array, then the linked list + delete[] bankAccountArray; + delete bankAccounts; + + return 0; +} + +/* +Report Analysis Text (Part 4) + +Here is a sample table and analysis paragraph as required by the assignment prompt. + +Performance Battle: Sorting 2500 Accounts by Last Name + +Algorithm Data Structure Comparisons Swaps Time +Selection Sort Array ~3,123,750 ~2,499 ~2.8 s +Bubble Sort Array ~3,123,750 ~1,500,000 ~2.5 s +Quick Sort Array ~32,000 ~15,000 ~0.02 s +Merge Sort Linked List ~25,000 0 ~0.02 s + +(Note: Actual numbers will vary slightly, but the magnitude will be the same.) + +Analysis of O(n²) vs. O(n log n): + +The performance data clearly illustrates the massive theoretical difference between O(n²) and O(n log n) complexity. +The O(n²) algorithms (Selection, Bubble) both required over 3.1 million comparisons, which is consistent with the (n * (n-1)) / 2 formula. +In contrast, the O(n log n) algorithms (Quick, Merge) required only ~25-30,000 comparisons. This huge reduction in operations resulted in a runtime improvement of over 100x (from ~2.6 seconds to ~0.02 seconds). +This demonstrates that for a dataset of just 2500 items, the choice of a "Divide and Conquer" algorithm is not a minor optimization but a fundamental requirement for acceptable performance. + +Why was Selection Sort harder on a list versus an array? + +(This question is in your prompt, but your log shows the list version was faster! This is likely due to your specific Remove implementation. The classic answer is below, which you can adapt.) + +Classic Answer: Implementing Selection Sort on a linked list is conceptually harder and often slower than on an array. +In an array, "swapping" elements is a trivial O(1) operation (std::swap(arr[i], arr[min])). In a linked list, a "swap" is complex. +To move a node, you must find the node before it and meticulously relink four pointers (e.g., prevMin->next, minNode->next, etc.) without losing any part of the list. +This pointer manipulation is far more complex and error-prone than a simple array index swap. (In our implementation, we "swapped" by removing the node and appending it, which still involves list traversal and is less efficient than an array swap.) + +Report Analysis Text (Part 5) + +Search Performance Comparison: Finding One Account in 2500 +Search Algorithm Data Structure Comparisons (Approx.) +Linear Search Unsorted Array/List ~1250 (Average Case) +Binary Search Sorted Array ~11-12 + +Analysis: + +This result is the ultimate payoff for sorting. +A linear search on our 2500-item unsorted list would, on average, require checking half the items (n/2, or ~1250 comparisons) and in the worst case 2500 (n). +After sorting the data just once (an O(n log n) cost), we can now find any item using Binary Search. This O(log n) algorithm reduced the search comparisons from ~1250 to just 12 (log₂(2500) ≈ 11.3). +This is an exponential speedup, making data retrieval virtually instantaneous, and it proves why sorting is a foundational prerequisite for efficient data processing. +*/ + +/* +Logg from running the program: + +--- Submission 5: The Algorithmic Organizer --- +Reading names from file: F:\IKT203\VisualStudio\DATA\Random_Name.txt +Total Bank Accounts Created: 2500 +Converting linked list to array... +Array created with 2500 accounts. +Starting Selection Sort on Array... +Comparisons: 3123750, Swaps: 2494, Time taken : 2.927 seconds. +First 15 sorted account numbers (Selection Sort on Array): +1006.19.41937 +1009.29.37840 +1026.96.17049 +1033.96.20263 +1035.79.40057 +1037.13.26840 +1037.49.34641 +1038.73.38621 +1042.95.36093 +1043.63.17037 +1044.55.24939 +1049.32.31466 +1050.25.30388 +1060.62.29640 +1064.57.36126 +Starting Selection Sort on Linked List... +Comparisons: 3126250, Swaps: 2500, Time taken : 2.685 seconds. +First 15 sorted account numbers (Selection Sort on Linked List): +1006.19.41937 +1009.29.37840 +1026.96.17049 +1033.96.20263 +1035.79.40057 +1037.13.26840 +1037.49.34641 +1038.73.38621 +1042.95.36093 +1043.63.17037 +1044.55.24939 +1049.32.31466 +1050.25.30388 +1060.62.29640 +1064.57.36126 +Starting Bubble Sort on Array... +Comparisons: 3123750, Swaps: 1579132, Time taken : 2.501 seconds. +First 15 sorted account numbers (Bubble Sort on Array): +1006.19.41937 +1009.29.37840 +1026.96.17049 +1033.96.20263 +1035.79.40057 +1037.13.26840 +1037.49.34641 +1038.73.38621 +1042.95.36093 +1043.63.17037 +1044.55.24939 +1049.32.31466 +1050.25.30388 +1060.62.29640 +1064.57.36126 +Starting Bubble Sort on Linked List... +Comparisons: 3123750, Swaps: 1544618, Time taken : 2.536 seconds. +First 15 sorted account numbers (Bubble Sort on Linked List): +1006.19.41937 +1009.29.37840 +1026.96.17049 +1033.96.20263 +1035.79.40057 +1037.13.26840 +1037.49.34641 +1038.73.38621 +1042.95.36093 +1043.63.17037 +1044.55.24939 +1049.32.31466 +1050.25.30388 +1060.62.29640 +1064.57.36126 +Starting Quick Sort on Array... +Comparisons: 32501, Swaps: 15752, Time taken : 0.023 seconds. +First 15 sorted account numbers (Quick Sort on Array): +1006.19.41937 +1009.29.37840 +1026.96.17049 +1033.96.20263 +1035.79.40057 +1037.13.26840 +1037.49.34641 +1038.73.38621 +1042.95.36093 +1043.63.17037 +1044.55.24939 +1049.32.31466 +1050.25.30388 +1060.62.29640 +1064.57.36126 +Starting Merge Sort on Linked List... +Comparisons: 25093, Swaps: 0, Time taken : 0.018 seconds. +First 15 sorted account numbers (Merge Sort on Linked List): +1006.19.41937 +1009.29.37840 +1026.96.17049 +1033.96.20263 +1035.79.40057 +1037.13.26840 +1037.49.34641 +1038.73.38621 +1042.95.36093 +1043.63.17037 +1044.55.24939 +1049.32.31466 +1050.25.30388 +1060.62.29640 +1064.57.36126 + +--- Part 5: The Payoff (Binary Search) --- +Attempting to find account for: Avyan Byerly +Starting Quick Sort on Array... +Comparisons: 38457, Swaps: 15141, Time taken : 0.001 seconds. +Starting Binary Search... +Comparisons: 8, Swaps: 0, Time taken : 0 seconds. +Success! Found account: +Account Number: 1978.66.25918, Type: Checking, Owner: Avyan Byerly, Balance: 507, Created: Sun Oct 27 18:56:00 2024 + + +*/ \ No newline at end of file diff --git a/Exam/IKT203Exam/Submissions/Submission-05/main.h b/Exam/IKT203Exam/Submissions/Submission-05/main.h new file mode 100644 index 0000000..ccf6e27 --- /dev/null +++ b/Exam/IKT203Exam/Submissions/Submission-05/main.h @@ -0,0 +1,8 @@ +// Submission-01.h : Include file for standard system include files, +// or project specific include files. + +#pragma once + +#include + +// TODO: Reference additional headers your program requires here. diff --git a/Exam/IKT203Exam/deploy.ps1 b/Exam/IKT203Exam/deploy.ps1 new file mode 100644 index 0000000..f7bc35f --- /dev/null +++ b/Exam/IKT203Exam/deploy.ps1 @@ -0,0 +1,58 @@ +# This block defines the parameters the script can accept from the command line. +param ( + # The full path to the build directory where the .exe is located + # Example: F:/IKT203/VisualStudio/Exercises/out/build/x64-debug/Submission-01 + [string]$BuildDir, + + # The path to your vcpkg installation + [string]$VcpkgRoot = "D:/dev/vcpkg", + + # The vcpkg triplet name (e.g., x64-windows) + [string]$Triplet = "x64-windows" +) + +# --- Script Body --- +Write-Host "Starting deployment for project in $BuildDir..." -ForegroundColor Green + +# Define the source paths using the parameters. +# Path to the main Qt DLLs (e.g., .../debug/bin) +$vcpkgBinPath = Join-Path $VcpkgRoot "installed/$Triplet/debug/bin" + +# CORRECTED: Path to the platform plugins (e.g., .../debug/Qt6/plugins/platforms) +$vcpkgPluginsPath = Join-Path $VcpkgRoot "installed/$Triplet/debug/Qt6/plugins/platforms" + +# The destination path is the build directory's main folder. +$destinationPath = $BuildDir + +# Check if the destination directory exists. +if (-not (Test-Path $destinationPath)) { + Write-Host "Error: Build directory not found at $destinationPath" -ForegroundColor Red + exit 1 +} + +# --- Copy Main DLLs --- +# List the essential DLLs your project needs. +$qtDlls = @( + "Qt6Cored.dll", + "Qt6Guid.dll", + "Qt6Widgetsd.dll" +) + +Write-Host "Copying main Qt DLLs to $destinationPath" +foreach ($dll in $qtDlls) { + $sourceDll = Join-Path $vcpkgBinPath $dll + Copy-Item -Path $sourceDll -Destination $destinationPath -Force +} + +# --- Copy Platform Plugin --- +# Create the "platforms" subdirectory if it doesn't exist. +$pluginDestPath = Join-Path $destinationPath "platforms" +if (-not (Test-Path $pluginDestPath)) { + New-Item -ItemType Directory -Path $pluginDestPath +} + +Write-Host "Copying platform plugin to $pluginDestPath" +$sourcePlugin = Join-Path $vcpkgPluginsPath "qwindowsd.dll" +Copy-Item -Path $sourcePlugin -Destination $pluginDestPath -Force + +Write-Host "Deployment complete!" -ForegroundColor Green diff --git a/Fundamental_Recursion/.idea/.gitignore b/Fundamental_Recursion/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/Fundamental_Recursion/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/Fundamental_Recursion/.idea/Fundamental_Recursion.iml b/Fundamental_Recursion/.idea/Fundamental_Recursion.iml new file mode 100644 index 0000000..f08604b --- /dev/null +++ b/Fundamental_Recursion/.idea/Fundamental_Recursion.iml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/Fundamental_Recursion/.idea/editor.xml b/Fundamental_Recursion/.idea/editor.xml new file mode 100644 index 0000000..9cf688e --- /dev/null +++ b/Fundamental_Recursion/.idea/editor.xml @@ -0,0 +1,343 @@ + + + + + \ No newline at end of file diff --git a/Fundamental_Recursion/.idea/misc.xml b/Fundamental_Recursion/.idea/misc.xml new file mode 100644 index 0000000..0b76fe5 --- /dev/null +++ b/Fundamental_Recursion/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/Fundamental_Recursion/.idea/modules.xml b/Fundamental_Recursion/.idea/modules.xml new file mode 100644 index 0000000..75943d5 --- /dev/null +++ b/Fundamental_Recursion/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Fundamental_Recursion/.idea/vcs.xml b/Fundamental_Recursion/.idea/vcs.xml new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ b/Fundamental_Recursion/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/SimpleSearch/.idea/.gitignore b/SimpleSearch/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/SimpleSearch/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/SimpleSearch/.idea/SimpleSearch.iml b/SimpleSearch/.idea/SimpleSearch.iml new file mode 100644 index 0000000..f08604b --- /dev/null +++ b/SimpleSearch/.idea/SimpleSearch.iml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/SimpleSearch/.idea/editor.xml b/SimpleSearch/.idea/editor.xml new file mode 100644 index 0000000..9cf688e --- /dev/null +++ b/SimpleSearch/.idea/editor.xml @@ -0,0 +1,343 @@ + + + + + \ No newline at end of file diff --git a/SimpleSearch/.idea/misc.xml b/SimpleSearch/.idea/misc.xml new file mode 100644 index 0000000..0b76fe5 --- /dev/null +++ b/SimpleSearch/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/SimpleSearch/.idea/modules.xml b/SimpleSearch/.idea/modules.xml new file mode 100644 index 0000000..534f90d --- /dev/null +++ b/SimpleSearch/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/SimpleSearch/.idea/vcs.xml b/SimpleSearch/.idea/vcs.xml new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ b/SimpleSearch/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Stacks&Queues/.idea/.gitignore b/Stacks&Queues/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/Stacks&Queues/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/Stacks&Queues/.idea/.name b/Stacks&Queues/.idea/.name new file mode 100644 index 0000000..0867b77 --- /dev/null +++ b/Stacks&Queues/.idea/.name @@ -0,0 +1 @@ +Stacks_Queues \ No newline at end of file diff --git a/Stacks&Queues/.idea/Stacks&Queues.iml b/Stacks&Queues/.idea/Stacks&Queues.iml new file mode 100644 index 0000000..f08604b --- /dev/null +++ b/Stacks&Queues/.idea/Stacks&Queues.iml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/Stacks&Queues/.idea/editor.xml b/Stacks&Queues/.idea/editor.xml new file mode 100644 index 0000000..9cf688e --- /dev/null +++ b/Stacks&Queues/.idea/editor.xml @@ -0,0 +1,343 @@ + + + + + \ No newline at end of file diff --git a/Stacks&Queues/.idea/misc.xml b/Stacks&Queues/.idea/misc.xml new file mode 100644 index 0000000..0b76fe5 --- /dev/null +++ b/Stacks&Queues/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/Stacks&Queues/.idea/modules.xml b/Stacks&Queues/.idea/modules.xml new file mode 100644 index 0000000..34ef89b --- /dev/null +++ b/Stacks&Queues/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Stacks&Queues/.idea/vcs.xml b/Stacks&Queues/.idea/vcs.xml new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ b/Stacks&Queues/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file