title
I did a C++ University Assignment

description
The first 1,000 people to use this link will get a 1 month free trial of Skillshare: https://skl.sh/thecherno07211 Patreon ► https://patreon.com/thecherno Instagram ► https://instagram.com/thecherno Twitter ► https://twitter.com/thecherno Discord ► https://thecherno.com/discord 0:00 - Intro 3:30 - Assignment requirements 12:56 - Doing the assignment 49:10 - Outro Code ► Coming soon... Send an email to chernoreview@gmail.com with your source code, a brief explanation, and what you need help with/want me to review and you could be in the next episode of my Code Review series! Also let me know if you would like to remain anonymous. This video is sponsored by Skillshare.

detail
{'title': 'I did a C++ University Assignment', 'heatmap': [{'end': 1363.824, 'start': 1326.78, 'weight': 0.769}, {'end': 2962.716, 'start': 2928.568, 'weight': 1}], 'summary': "A youtuber plans to rewrite a university assignment in a sponsored 'code review' video, highlighting skillshare's benefits and offering a one month free trial for the first 1000 users. the video delves into implementing a hash table for english words, setting up a compiler, and handling input and commands in c++. it also details utilizing std string constructor, creating a hash table class, and conducting hash table operations, resulting in improved code and successful test cases.", 'chapters': [{'end': 197.277, 'segs': [{'end': 87.023, 'src': 'embed', 'start': 55.488, 'weight': 0, 'content': [{'end': 59.37, 'text': 'talk about the requirements and then implement this as best as I can.', 'start': 55.488, 'duration': 3.882}, {'end': 60.711, 'text': 'Now, a fair warning.', 'start': 59.55, 'duration': 1.161}, {'end': 66.437, 'text': "What I'm looking at is a real second year university assignment.", 'start': 61.571, 'duration': 4.866}, {'end': 72.245, 'text': 'I think the unit subject is called something like data algorithms and patterns or something like that.', 'start': 66.477, 'duration': 5.768}, {'end': 77.552, 'text': 'This is the exact same assignment that we looked at last time we did a code review.', 'start': 72.405, 'duration': 5.147}, {'end': 79.374, 'text': 'Like this is, this is it.', 'start': 78.112, 'duration': 1.262}, {'end': 81.116, 'text': "We're going to be doing that exact one.", 'start': 79.414, 'duration': 1.702}, {'end': 87.023, 'text': "The reason why I'm being so specific about this is because this is a, in my opinion, quite an odd university assignment.", 'start': 81.196, 'duration': 5.827}], 'summary': 'Discussing the implementation of a second-year university assignment in data algorithms and patterns.', 'duration': 31.535, 'max_score': 55.488, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY55488.jpg'}, {'end': 197.277, 'src': 'embed', 'start': 140.19, 'weight': 1, 'content': [{'end': 146.176, 'text': 'Anything from creative topics such as like videography, photography, editing, illustration,', 'start': 140.19, 'duration': 5.986}, {'end': 149.479, 'text': 'all the way over to like business and marketing and productivity.', 'start': 146.176, 'duration': 3.303}, {'end': 152.64, 'text': "They've also got excellent courses on how to make YouTube videos.", 'start': 149.619, 'duration': 3.021}, {'end': 155.101, 'text': 'I really like this one by MKBHD.', 'start': 152.78, 'duration': 2.321}, {'end': 161.424, 'text': 'As a C++ programmer, I am pretty much all about efficiency and I think Skillshare does an excellent job at that.', 'start': 155.301, 'duration': 6.123}, {'end': 167.086, 'text': "Skillshare's videos are really well-made and they're really kind of well-timed.", 'start': 161.744, 'duration': 5.342}, {'end': 170.827, 'text': "They're like these bite-sized chunks that you can just watch when you have a spare five minutes.", 'start': 167.166, 'duration': 3.661}, {'end': 175.269, 'text': "You don't have to wait till the end of the day and allocate like an hour or two to just spend on this thing.", 'start': 170.847, 'duration': 4.422}, {'end': 177.57, 'text': 'You can just consume it kind of on the go.', 'start': 175.309, 'duration': 2.261}, {'end': 180.671, 'text': 'Coming in at just under $10 a month for an annual subscription.', 'start': 177.79, 'duration': 2.881}, {'end': 188.954, 'text': 'I think Skillshare is fantastic value, but also the first 1000 people who click the link in the description below will receive a one month free trial.', 'start': 180.671, 'duration': 8.283}, {'end': 197.277, 'text': "A one month free trial of Skillshare premium is plenty of time to explore the platform, see what they've got and see what courses you like.", 'start': 189.114, 'duration': 8.163}], 'summary': 'Skillshare offers diverse, efficient courses at a great value, including a one month free trial for the first 1000 people.', 'duration': 57.087, 'max_score': 140.19, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY140190.jpg'}], 'start': 0.049, 'title': "Youtuber's university assignment and skillshare", 'summary': "Discusses the youtuber's plan to rewrite a university assignment in a fun 'code review' video sponsored by skillshare, and emphasizes skillshare's convenience, efficiency, and cost-effectiveness, including a one month free trial offer for the first 1000 users.", 'chapters': [{'end': 121.057, 'start': 0.049, 'title': 'University assignment code review', 'summary': "Discusses the youtuber's plan to rewrite a university assignment in a fun 'code review' video, based on a real second-year university assignment, sponsored by skillshare.", 'duration': 121.008, 'highlights': ["The YouTuber plans to rewrite a real second-year university assignment in a 'code review' video on their channel, based on an assignment related to data algorithms and patterns.", 'The video is sponsored by Skillshare, a key point to note as it influences the content and provides context for the audience.', 'The YouTuber received the university assignment from a previous code review and decided to rewrite it in a fun and engaging manner for the viewers.']}, {'end': 197.277, 'start': 121.117, 'title': 'Skillshare: online learning community', 'summary': 'Discusses skillshare, an online learning platform with millions of users offering a variety of courses from creative to business and productivity, emphasizing its convenience, efficiency, and cost-effectiveness, including a one month free trial offer for the first 1000 users.', 'duration': 76.16, 'highlights': ['Skillshare offers a wide range of courses, from creative subjects like videography, photography, and editing to business and marketing, catering to millions of users worldwide.', "Skillshare's well-made and well-timed bite-sized videos allow for efficient learning in spare moments, contributing to its value and convenience.", 'Skillshare provides a one month free trial for the first 1000 users, allowing ample time to explore the platform and its courses, emphasizing its cost-effectiveness and user-friendly approach.']}], 'duration': 197.228, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY49.jpg', 'highlights': ["The YouTuber plans to rewrite a real second-year university assignment in a 'code review' video on their channel, based on an assignment related to data algorithms and patterns.", 'Skillshare offers a wide range of courses, from creative subjects like videography, photography, and editing to business and marketing, catering to millions of users worldwide.', 'Skillshare provides a one month free trial for the first 1000 users, allowing ample time to explore the platform and its courses, emphasizing its cost-effectiveness and user-friendly approach.', 'The video is sponsored by Skillshare, a key point to note as it influences the content and provides context for the audience.']}, {'end': 767.28, 'segs': [{'end': 241.627, 'src': 'embed', 'start': 210.985, 'weight': 7, 'content': [{'end': 215.909, 'text': 'Okay, so I just spent a little bit of time going through the actual assignment requirements, that whole kind of sheet,', 'start': 210.985, 'duration': 4.924}, {'end': 220.132, 'text': 'and then rearranging them into this kind of dot point format that we can take a look at together.', 'start': 215.909, 'duration': 4.223}, {'end': 223.315, 'text': "So the first thing is the assignment's gonna be marked automatically.", 'start': 220.172, 'duration': 3.143}, {'end': 227.038, 'text': "So it's gonna be put through like a bunch of test cases, as we'll see in a minute.", 'start': 223.395, 'duration': 3.643}, {'end': 230.02, 'text': 'Failure to follow this guideline will result in zero.', 'start': 227.778, 'duration': 2.242}, {'end': 232.122, 'text': "So they're pretty serious about these requirements.", 'start': 230.1, 'duration': 2.022}, {'end': 241.627, 'text': 'Exactly one file, main.cpp, no design documents need to be submitted, and the task is basically to implement a very specific hash table.', 'start': 232.722, 'duration': 8.905}], 'summary': 'Assignment will be marked automatically, must submit main.cpp, zero tolerance for guideline violation.', 'duration': 30.642, 'max_score': 210.985, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY210985.jpg'}, {'end': 319.903, 'src': 'embed', 'start': 295.496, 'weight': 4, 'content': [{'end': 305.02, 'text': "It's unlike anything that I've actually seen in the real world, which first of all does kind of kind of brings up the point of is this even useful?", 'start': 295.496, 'duration': 9.524}, {'end': 312.802, 'text': 'But I think in a way it is because this assignment is a good example of getting you to actually follow requirements,', 'start': 305.12, 'duration': 7.682}, {'end': 315.542, 'text': 'because it needs to be done exactly in this way.', 'start': 312.802, 'duration': 2.74}, {'end': 319.903, 'text': 'So this very specific hash table, what is it? Keys are lowercase English words.', 'start': 315.762, 'duration': 4.141}], 'summary': 'Assignment emphasizes following requirements, using specific hash table for lowercase english words.', 'duration': 24.407, 'max_score': 295.496, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY295496.jpg'}, {'end': 375.046, 'src': 'embed', 'start': 344.919, 'weight': 0, 'content': [{'end': 347.841, 'text': "But of course we can deal with collisions as we'll find out in a minute.", 'start': 344.919, 'duration': 2.922}, {'end': 351.484, 'text': 'The hash table contains exactly 26 slots, A to Z.', 'start': 348.001, 'duration': 3.483}, {'end': 356.489, 'text': "By the way, if you're following along with this at home, try and write down these requirements and implement this for yourself.", 'start': 351.484, 'duration': 5.005}, {'end': 359.853, 'text': "I think it'll be a good exercise and then we can compare our solutions in the end.", 'start': 356.529, 'duration': 3.324}, {'end': 364.277, 'text': "You won't need more because of course this is designed to just go through the test cases.", 'start': 359.973, 'duration': 4.304}, {'end': 365.498, 'text': "It's marked automatically.", 'start': 364.657, 'duration': 0.841}, {'end': 367.9, 'text': 'If it goes through the test cases, you win.', 'start': 365.538, 'duration': 2.362}, {'end': 375.046, 'text': "That's not to say we should maybe hack this and just produce something that isn't even a hash table, but you know that is.", 'start': 368.121, 'duration': 6.925}], 'summary': 'The hash table has 26 slots from a to z, and passing the test cases results in a win.', 'duration': 30.127, 'max_score': 344.919, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY344919.jpg'}, {'end': 428.366, 'src': 'embed', 'start': 401.284, 'weight': 3, 'content': [{'end': 405.027, 'text': 'So basically, I guess in the beginning we initialized 26 slots, all with never used.', 'start': 401.284, 'duration': 3.743}, {'end': 406.888, 'text': 'Searching works as follows.', 'start': 405.547, 'duration': 1.341}, {'end': 409.951, 'text': 'So given a key, take its last character as the hash value.', 'start': 406.928, 'duration': 3.023}, {'end': 415.235, 'text': 'So if we enter a key like Apple, then E is in fact the last character.', 'start': 410.171, 'duration': 5.064}, {'end': 417.236, 'text': 'First try the corresponding table slot.', 'start': 415.375, 'duration': 1.861}, {'end': 423.401, 'text': 'So each letter in the English alphabet, A through Z, has a table slot.', 'start': 417.276, 'duration': 6.125}, {'end': 428.366, 'text': "So we could basically have an array where it's like from zero to 25,", 'start': 423.902, 'duration': 4.464}], 'summary': 'Initialized 26 slots, each letter has a table slot, using hash value for search.', 'duration': 27.082, 'max_score': 401.284, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY401284.jpg'}, {'end': 512.509, 'src': 'embed', 'start': 482.787, 'weight': 2, 'content': [{'end': 485.369, 'text': 'So first perform search to see if the key exists.', 'start': 482.787, 'duration': 2.582}, {'end': 487.851, 'text': 'If it does, then do nothing.', 'start': 485.99, 'duration': 1.861}, {'end': 492.135, 'text': 'Take the last character of key as hash value.', 'start': 488.432, 'duration': 3.703}, {'end': 495.037, 'text': "So we get, if we're trying to insert Apple, we take E.", 'start': 492.175, 'duration': 2.862}, {'end': 498.86, 'text': 'If that slot is not occupied, put the key there and occupy the slot.', 'start': 495.037, 'duration': 3.823}, {'end': 501.942, 'text': "If it's occupied, try the next slot until you find a free slot.", 'start': 499, 'duration': 2.942}, {'end': 505.124, 'text': 'So this is the collision kind of management.', 'start': 502.322, 'duration': 2.802}, {'end': 508.586, 'text': 'So what happens is if we already have Apple in the list.', 'start': 505.304, 'duration': 3.282}, {'end': 512.509, 'text': "I mean I'm even accidentally calling it a list instead of a hash table, because that's basically what it is.", 'start': 508.586, 'duration': 3.923}], 'summary': 'Use last character of key as hash value for collision management in hash table.', 'duration': 29.722, 'max_score': 482.787, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY482787.jpg'}, {'end': 655.96, 'src': 'embed', 'start': 613.885, 'weight': 5, 'content': [{'end': 621.46, 'text': "So the search function needs a way then to basically terminate if it has in fact searched everything and it couldn't find it.", 'start': 613.885, 'duration': 7.575}, {'end': 627.707, 'text': 'Again, very unlikely because we will run into a never used unless the hash table is full.', 'start': 621.541, 'duration': 6.166}, {'end': 630.63, 'text': 'So I guess we can ignore that.', 'start': 628.488, 'duration': 2.142}, {'end': 633.513, 'text': 'When program starts, init empty hash table.', 'start': 630.75, 'duration': 2.763}, {'end': 635.295, 'text': 'So 26 never used slots, okay.', 'start': 633.573, 'duration': 1.722}, {'end': 641.036, 'text': 'Command line input is one through 26 modification moves separated by spaces.', 'start': 635.775, 'duration': 5.261}, {'end': 647.198, 'text': 'So moves are A word, which is the character A followed by a lowercase English word of up to 10 characters.', 'start': 641.096, 'duration': 6.102}, {'end': 650.799, 'text': 'So A apple means insert key apple into hash table.', 'start': 647.238, 'duration': 3.561}, {'end': 653.359, 'text': 'Same with D except D is for delete.', 'start': 651.659, 'duration': 1.7}, {'end': 655.96, 'text': 'So delete apple from hash table is D apple.', 'start': 653.399, 'duration': 2.561}], 'summary': 'Implement a search function with 26 empty slots for modification moves including insert and delete commands.', 'duration': 42.075, 'max_score': 613.885, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY613885.jpg'}, {'end': 708.893, 'src': 'embed', 'start': 680.998, 'weight': 6, 'content': [{'end': 683.861, 'text': 'Submit via SVN, and then marking done automatically.', 'start': 680.998, 'duration': 2.863}, {'end': 685.522, 'text': 'Total mark is 10, one for compiling.', 'start': 683.901, 'duration': 1.621}, {'end': 688.484, 'text': 'and then nine marks for nine test cases.', 'start': 686.323, 'duration': 2.161}, {'end': 697.527, 'text': "And it's also compiled using G++ with C++ 11, optimization two, warning us all, main.cpp.", 'start': 688.604, 'duration': 8.923}, {'end': 701.209, 'text': 'So obviously we have to provide a main.cpp, as it mentioned above,', 'start': 697.907, 'duration': 3.302}, {'end': 708.893, 'text': 'And then we also have to make sure that we are in fact only using C++ 11 and that it compiles with G++.', 'start': 702.065, 'duration': 6.828}], 'summary': 'Submit via svn for automatic marking. 10 marks: 1 for compiling, 9 for test cases. compile using g++ with c++ 11 and optimization two.', 'duration': 27.895, 'max_score': 680.998, 'thumbnail': ''}], 'start': 197.377, 'title': 'Hash table implementation', 'summary': 'Discusses the implementation of a specific hash table for storing 26 english words, emphasizing precise guidelines, collision management, efficient search and insertion operations, and the process of deletion, including key deletion and search function termination.', 'chapters': [{'end': 344.799, 'start': 197.377, 'title': 'University assignment - specific hash table', 'summary': 'Discusses a university assignment that requires the implementation of a very specific hash table for storing 26 english words, emphasizing the importance of following precise guidelines.', 'duration': 147.422, 'highlights': ['The assignment requires the implementation of a very specific hash table for storing 26 English words, focusing on lowercase words with a maximum length of 10 characters and using the last character as the hash function.', 'The assignment will be marked automatically and failure to adhere to the guidelines will result in zero.', 'The task does not involve associative arrays and is distinct from real-world applications, highlighting the emphasis on following precise requirements.']}, {'end': 569.161, 'start': 344.919, 'title': 'Hash table collision management', 'summary': 'Discusses the implementation of a hash table with 26 slots, detailing the searching and insertion processes, collision management, and the potential scenarios for slot usage, with emphasis on the efficient search and insertion operations within the hash table.', 'duration': 224.242, 'highlights': ['The hash table contains exactly 26 slots, A to Z, designed for efficient search and insertion operations, with emphasis on collision management and the potential scenarios for slot usage.', 'The searching process involves taking the last character of the key as the hash value and trying the corresponding table slot, followed by moving to the next slot if the current one is occupied or a tombstone, with the possibility of wrapping the table if needed.', 'The insertion process includes performing a search to check for key existence, taking the last character of the key as the hash value, and putting the key in an unoccupied slot, with provisions for collision management by trying the next slot until a free one is found.']}, {'end': 767.28, 'start': 569.301, 'title': 'Hash table deletion process', 'summary': 'Discusses the process of deletion in a hash table, including handling of key deletion, search function termination, command line input format, and compiler requirements for the assignment.', 'duration': 197.979, 'highlights': ["Command line input format The command line input consists of one through 26 modification moves separated by spaces, with moves being represented by 'A' followed by a lowercase English word of up to 10 characters for insertion and 'D' for deletion.", 'Compiler requirements for the assignment The code is compiled using G++ with C++ 11, optimization two, warning as all, and the main.cpp file is to be provided, ensuring compliance with the mentioned requirements.', "Search function termination The search function needs a way to terminate if it has searched everything and couldn't find the key, which is very unlikely unless the hash table is full."]}], 'duration': 569.903, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY197377.jpg', 'highlights': ['The hash table contains exactly 26 slots, A to Z, designed for efficient search and insertion operations, with emphasis on collision management and the potential scenarios for slot usage.', 'The assignment requires the implementation of a very specific hash table for storing 26 English words, focusing on lowercase words with a maximum length of 10 characters and using the last character as the hash function.', 'The insertion process includes performing a search to check for key existence, taking the last character of the key as the hash value, and putting the key in an unoccupied slot, with provisions for collision management by trying the next slot until a free one is found.', 'The searching process involves taking the last character of the key as the hash value and trying the corresponding table slot, followed by moving to the next slot if the current one is occupied or a tombstone, with the possibility of wrapping the table if needed.', 'The task does not involve associative arrays and is distinct from real-world applications, highlighting the emphasis on following precise requirements.', "Command line input format The command line input consists of one through 26 modification moves separated by spaces, with moves being represented by 'A' followed by a lowercase English word of up to 10 characters for insertion and 'D' for deletion.", 'Compiler requirements for the assignment The code is compiled using G++ with C++ 11, optimization two, warning as all, and the main.cpp file is to be provided, ensuring compliance with the mentioned requirements.', 'The assignment will be marked automatically and failure to adhere to the guidelines will result in zero.', "Search function termination The search function needs a way to terminate if it has searched everything and couldn't find the key, which is very unlikely unless the hash table is full."]}, {'end': 1326.38, 'segs': [{'end': 831.079, 'src': 'embed', 'start': 805.226, 'weight': 2, 'content': [{'end': 811.49, 'text': "Now, if we take a look at the university requirements, they're pretty specific, meaning that we need to use basically this exact.", 'start': 805.226, 'duration': 6.264}, {'end': 813.291, 'text': 'Command to compile our code.', 'start': 811.85, 'duration': 1.441}, {'end': 819.694, 'text': "if we don't do that, Then there's a possibility that of course it won't compile, like if our files are not named correctly or something like that.", 'start': 813.291, 'duration': 6.403}, {'end': 820.614, 'text': "It just won't compile.", 'start': 819.694, 'duration': 0.92}, {'end': 823.695, 'text': "obviously, on the automated testing and when you're dealing with automated testing,", 'start': 820.614, 'duration': 3.081}, {'end': 827.837, 'text': 'you to make sure that everything works Exactly the same way that is going to be automatically tested.', 'start': 823.695, 'duration': 4.142}, {'end': 831.079, 'text': "I don't want to get zero for this assignment So we have to use this.", 'start': 828.037, 'duration': 3.042}], 'summary': 'University requirements demand exact code for compilation and automated testing to avoid zero grade.', 'duration': 25.853, 'max_score': 805.226, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY805226.jpg'}, {'end': 863.067, 'src': 'embed', 'start': 835.943, 'weight': 0, 'content': [{'end': 839.086, 'text': "Now, I don't think that like, we're not going to be the ones running the command.", 'start': 835.943, 'duration': 3.143}, {'end': 842.509, 'text': "We don't need to write a file, like a script for the server to execute or whatever.", 'start': 839.106, 'duration': 3.403}, {'end': 843.79, 'text': "They're going to be running the command.", 'start': 842.529, 'duration': 1.261}, {'end': 845.852, 'text': "So this is just for us and we're on Windows.", 'start': 843.81, 'duration': 2.042}, {'end': 851.017, 'text': "So I'm just going to touch a file here called like build.bat and then inside that build.bat file that we've just made.", 'start': 845.992, 'duration': 5.025}, {'end': 852.618, 'text': "Let's go ahead and drag it here.", 'start': 851.417, 'duration': 1.201}, {'end': 854.48, 'text': 'And then we can paste in that command.', 'start': 852.878, 'duration': 1.602}, {'end': 855.36, 'text': "That's all we're doing.", 'start': 854.58, 'duration': 0.78}, {'end': 863.067, 'text': "It's just so that instead of actually having to run that command every time, I can just call build.bat like this.", 'start': 855.481, 'duration': 7.586}], 'summary': 'Creating a build.bat file on windows to automate command execution.', 'duration': 27.124, 'max_score': 835.943, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY835943.jpg'}, {'end': 933.462, 'src': 'embed', 'start': 906.959, 'weight': 1, 'content': [{'end': 913.944, 'text': 'So the first thing I always do in these cases I mean always is just make sure that my tool chain is set up correctly,', 'start': 906.959, 'duration': 6.985}, {'end': 915.485, 'text': 'especially when compiling from the command line.', 'start': 913.944, 'duration': 1.541}, {'end': 919.589, 'text': 'So all you have to do for that is include like IO stream and just try and print something.', 'start': 915.806, 'duration': 3.783}, {'end': 922.732, 'text': "So I'm gonna go ahead and print hello like this.", 'start': 919.949, 'duration': 2.783}, {'end': 933.462, 'text': 'And then if we go back to our SIGWIN over here and trying to build up that, you can see that it compiles and it gives us a main.out.', 'start': 923.613, 'duration': 9.849}], 'summary': 'Ensure correct tool chain setup when compiling from command line, demonstrated by successful compilation and generation of main.out.', 'duration': 26.503, 'max_score': 906.959, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY906959.jpg'}, {'end': 1036.818, 'src': 'embed', 'start': 1012.491, 'weight': 4, 'content': [{'end': 1019.052, 'text': 'But before we do that, we also need to be able to take in a string like this and separate it by each space.', 'start': 1012.491, 'duration': 6.561}, {'end': 1020.692, 'text': 'Lots of different ways to do this.', 'start': 1019.452, 'duration': 1.24}, {'end': 1027.473, 'text': 'I think the most straightforward way that is also obviously supported in C++ 11 is just to use string stream, honestly.', 'start': 1020.772, 'duration': 6.701}, {'end': 1032.717, 'text': 'So what this means is that if we wanted to take a line in which it seems like if we look at the requirements,', 'start': 1027.875, 'duration': 4.842}, {'end': 1034.617, 'text': "they're not actually command line arguments.", 'start': 1032.717, 'duration': 1.9}, {'end': 1036.818, 'text': 'The sample input is literally this.', 'start': 1034.797, 'duration': 2.021}], 'summary': 'Using c++ 11, we can parse a string by space using stringstream.', 'duration': 24.327, 'max_score': 1012.491, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY1012491.jpg'}, {'end': 1081.777, 'src': 'embed', 'start': 1051.344, 'weight': 3, 'content': [{'end': 1054.505, 'text': "So because of that, let's go ahead and just basically write our input here.", 'start': 1051.344, 'duration': 3.161}, {'end': 1058.807, 'text': "We'll use the get line function to just get that input line from CN.", 'start': 1054.545, 'duration': 4.262}, {'end': 1060.907, 'text': 'This obviously gets our entire line.', 'start': 1058.847, 'duration': 2.06}, {'end': 1065.129, 'text': 'And then what I want to do is actually feed this into StringStream.', 'start': 1061.368, 'duration': 3.761}, {'end': 1074.173, 'text': 'So if I go std StringStream SS, with that input string, what I can do now is just keep pulling out tokens from this.', 'start': 1065.389, 'duration': 8.784}, {'end': 1081.777, 'text': 'So if I write a while loop that continues basically as long as that string stream still has tokens for us to process.', 'start': 1074.353, 'duration': 7.424}], 'summary': 'Using get line function to process input and extract tokens using stringstream in a while loop.', 'duration': 30.433, 'max_score': 1051.344, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY1051344.jpg'}, {'end': 1122.461, 'src': 'embed', 'start': 1095.724, 'weight': 6, 'content': [{'end': 1099.346, 'text': 'And you can see we basically have most of our input parsing sorted already.', 'start': 1095.724, 'duration': 3.622}, {'end': 1100.387, 'text': 'Very easy.', 'start': 1099.747, 'duration': 0.64}, {'end': 1101.468, 'text': "So I'll save that.", 'start': 1100.427, 'duration': 1.041}, {'end': 1103.669, 'text': 'By the way, we do not need a return zero.', 'start': 1101.828, 'duration': 1.841}, {'end': 1104.81, 'text': "That's not really required.", 'start': 1103.71, 'duration': 1.1}, {'end': 1107.832, 'text': "Although now that I'm thinking about it, maybe it is in C++ 11.", 'start': 1104.87, 'duration': 2.962}, {'end': 1108.993, 'text': "Maybe that's a newer feature.", 'start': 1107.832, 'duration': 1.161}, {'end': 1112.356, 'text': 'But no, actually, we would have gotten a warning, especially with warning all.', 'start': 1109.474, 'duration': 2.882}, {'end': 1115.518, 'text': 'So the main function is special in the fact that, even though it returns int,', 'start': 1112.636, 'duration': 2.882}, {'end': 1118.54, 'text': "you don't have to return anything and it will assume you're returning zero.", 'start': 1115.518, 'duration': 3.022}, {'end': 1122.461, 'text': "So let's go ahead and run our little command once again, and we'll see what we get.", 'start': 1118.8, 'duration': 3.661}], 'summary': 'Input parsing sorted, no need for return zero in main function', 'duration': 26.737, 'max_score': 1095.724, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY1095724.jpg'}, {'end': 1158.318, 'src': 'embed', 'start': 1129.624, 'weight': 7, 'content': [{'end': 1131.364, 'text': "I'll paste it in and run it.", 'start': 1129.624, 'duration': 1.74}, {'end': 1134.785, 'text': 'And you can see we get every token here on a separate string.', 'start': 1131.484, 'duration': 3.301}, {'end': 1136.446, 'text': "So that that's immediately done.", 'start': 1135.085, 'duration': 1.361}, {'end': 1139.807, 'text': 'I mean, you can see how quick that is really, really easy to use.', 'start': 1136.546, 'duration': 3.261}, {'end': 1144.83, 'text': 'and no need to go through every character, look for spaces, anything like that.', 'start': 1141.088, 'duration': 3.742}, {'end': 1153.175, 'text': 'We can just take advantage of the C++ standard library that was available to us back in the day, back in C++ 11.', 'start': 1144.87, 'duration': 8.305}, {'end': 1158.318, 'text': "Okay, so moving on now let's go with the kind of second part of the input, parsing, which is what do we want?", 'start': 1153.175, 'duration': 5.143}], 'summary': 'The transcript discusses parsing input using c++ standard library, specifically focusing on tokenization and ease of use.', 'duration': 28.694, 'max_score': 1129.624, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY1129624.jpg'}, {'end': 1198.089, 'src': 'embed', 'start': 1172.068, 'weight': 8, 'content': [{'end': 1179.054, 'text': 'So, in other words, if that first character of the token, so token zero is equal to A right?', 'start': 1172.068, 'duration': 6.986}, {'end': 1182.116, 'text': 'And remember, it has to be in this format, has to be uppercase.', 'start': 1179.094, 'duration': 3.022}, {'end': 1183.617, 'text': 'This has to be lowercase.', 'start': 1182.456, 'duration': 1.161}, {'end': 1185.178, 'text': "Everything's very much set in stone.", 'start': 1183.737, 'duration': 1.441}, {'end': 1187.18, 'text': "So it's really easy for us to do our jobs here.", 'start': 1185.519, 'duration': 1.661}, {'end': 1190.162, 'text': "If token equals A, then that's kind of it.", 'start': 1187.38, 'duration': 2.782}, {'end': 1190.843, 'text': 'Else if.', 'start': 1190.362, 'duration': 0.481}, {'end': 1193.045, 'text': "So there's no reason for us to check it again.", 'start': 1191.243, 'duration': 1.802}, {'end': 1198.089, 'text': "Um, so we can just use an else if, uh, we can go over here and, uh, check to see if it's deep.", 'start': 1193.065, 'duration': 5.024}], 'summary': "If token zero equals a, it must be uppercase, else check if it's lowercase.", 'duration': 26.021, 'max_score': 1172.068, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY1172068.jpg'}], 'start': 767.28, 'title': 'Setting up compiler and automated testing, input processing and command parsing, and input parsing and command handling in c++', 'summary': 'Covers setting up the compiler using sigwin and creating a batch file, input processing and command parsing using string streams and token extraction, and input parsing and command handling in c++ with c++ standard library features, ensuring adherence to university requirements and forming the foundation for testing the application.', 'chapters': [{'end': 962.47, 'start': 767.28, 'title': 'Setting up compiler and automated testing', 'summary': 'Discusses setting up the compiler, including using sigwin and creating a batch file to compile code, adhering to university requirements, and testing the tool chain by compiling and running the code.', 'duration': 195.19, 'highlights': ['Creating a batch file to compile code instead of running the command every time The speaker creates a batch file named build.bat to simplify the compilation process, avoiding the need to run the command manually each time.', "Testing the tool chain by compiling and running the code The speaker tests the tool chain by including IO stream, printing 'hello', and successfully compiling and running the code using SIGWIN.", 'Adhering to university requirements for compiling code The speaker emphasizes the need to adhere to specific university requirements for compiling code to avoid the possibility of it not compiling.']}, {'end': 1095.704, 'start': 962.47, 'title': 'Input processing and command parsing', 'summary': 'Discusses input processing and command parsing, highlighting the use of string streams and token extraction for parsing input, forming the foundation for testing the application.', 'duration': 133.234, 'highlights': ['The chapter highlights the importance of input processing and command parsing as the foundation for testing the application, emphasizing the use of string streams and token extraction for parsing input.', 'It discusses the need to determine whether the command is to add or delete, and the use of string streams to separate the input by each space, providing a straightforward approach supported in C++ 11.', 'The chapter emphasizes the use of getline function to retrieve input from CN and feed it into stringstream, enabling the extraction of tokens and confirming successful functionality through printing.']}, {'end': 1326.38, 'start': 1095.724, 'title': 'Input parsing and command handling in c++', 'summary': 'Covers the parsing of input tokens and handling of commands in c++, demonstrating the use of c++ standard library features like substring to process input tokens and execute commands, with quick and easy results.', 'duration': 230.656, 'highlights': ['The main function in C++ can assume a return value of zero even without an explicit return statement, simplifying code and potentially avoiding warnings.', 'The C++ standard library provides efficient methods for parsing input tokens, such as using substring to extract relevant information from tokens, resulting in quick and easy processing.', 'Commands can be handled effectively by checking the first character of each token and executing corresponding actions, providing a straightforward approach to command handling.']}], 'duration': 559.1, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY767280.jpg', 'highlights': ['Creating a batch file named build.bat to simplify the compilation process', "Testing the tool chain by including IO stream, printing 'hello', and successfully compiling and running the code using SIGWIN", 'Adhering to university requirements for compiling code', 'Emphasizing the use of string streams and token extraction for parsing input', 'Discussing the use of string streams to separate the input by each space, providing a straightforward approach supported in C++ 11', 'Emphasizing the use of getline function to retrieve input from CN and feed it into stringstream, enabling the extraction of tokens and confirming successful functionality through printing', 'The main function in C++ can assume a return value of zero even without an explicit return statement, simplifying code and potentially avoiding warnings', 'The C++ standard library provides efficient methods for parsing input tokens, such as using substring to extract relevant information from tokens, resulting in quick and easy processing', 'Commands can be handled effectively by checking the first character of each token and executing corresponding actions, providing a straightforward approach to command handling']}, {'end': 1652.903, 'segs': [{'end': 1401.171, 'src': 'heatmap', 'start': 1326.78, 'weight': 0, 'content': [{'end': 1333.765, 'text': "The other way that comes to mind that isn't really required is we could just use the constructor of std string that takes in like a const char pointer.", 'start': 1326.78, 'duration': 6.985}, {'end': 1344.151, 'text': 'So, in other words, if we were to get like this character from it, basically, except set this to be the memory address of the first character of this,', 'start': 1334.625, 'duration': 9.526}, {'end': 1345.692, 'text': 'which is this the memory address of this.', 'start': 1344.151, 'duration': 1.541}, {'end': 1350.195, 'text': 'Since it is just a string buffer, we can also do that, I assume.', 'start': 1345.892, 'duration': 4.303}, {'end': 1355.538, 'text': "I'm not going to lie, that actually came to mind first because I'm usually thinking about memory and stuff like that.", 'start': 1350.215, 'duration': 5.323}, {'end': 1359.221, 'text': 'But you can see that we get the same kind of result.', 'start': 1356.539, 'duration': 2.682}, {'end': 1363.824, 'text': 'I would probably leave it as substring just because it probably makes more sense to most people.', 'start': 1359.641, 'duration': 4.183}, {'end': 1364.824, 'text': 'Okay, brilliant.', 'start': 1364.204, 'duration': 0.62}, {'end': 1367.986, 'text': "So we've got the entry names, we've got all of the input parsing done.", 'start': 1364.984, 'duration': 3.002}, {'end': 1371.308, 'text': "It ignores everything, it's very clean, at least in my opinion.", 'start': 1368.246, 'duration': 3.062}, {'end': 1374.129, 'text': "So let's go ahead and talk about the actual hash table now.", 'start': 1371.408, 'duration': 2.721}, {'end': 1379.552, 'text': 'So the way that I wanna write this because we have some fair initialization code that we need to do.', 'start': 1374.749, 'duration': 4.803}, {'end': 1384.294, 'text': 'remember we have to fill in 26 slots with the status of never used.', 'start': 1379.552, 'duration': 4.742}, {'end': 1386.015, 'text': "So I'm actually gonna write a class for this.", 'start': 1384.634, 'duration': 1.381}, {'end': 1388.756, 'text': "It's not really required to do this.", 'start': 1386.895, 'duration': 1.861}, {'end': 1392.378, 'text': "Of course, you can write this however you like, but I'm kind of thinking of it as a class.", 'start': 1388.796, 'duration': 3.582}, {'end': 1394.821, 'text': 'and I wanna keep it organized under a class.', 'start': 1392.998, 'duration': 1.823}, {'end': 1397.585, 'text': "So what we're gonna do is write a hash table.", 'start': 1394.981, 'duration': 2.604}, {'end': 1401.171, 'text': 'To be honest, the constructor I think is probably just gonna be a default constructor.', 'start': 1398.266, 'duration': 2.905}], 'summary': 'Discussion on using std string constructor, substring, and creating a hash table with 26 slots; considering using a class for organization.', 'duration': 74.391, 'max_score': 1326.78, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY1326780.jpg'}, {'end': 1466.493, 'src': 'embed', 'start': 1442.018, 'weight': 4, 'content': [{'end': 1448.684, 'text': "G++ probably accepts non-const like stack allocated array things as well, but whatever, we'll leave it as this.", 'start': 1442.018, 'duration': 6.666}, {'end': 1452.047, 'text': "So let's go ahead and create that entry struct.", 'start': 1449.325, 'duration': 2.722}, {'end': 1457.612, 'text': "Again, I'm going to create this right within the hash table like this in the public section,", 'start': 1453.471, 'duration': 4.141}, {'end': 1460.132, 'text': "because we don't need to pollute the namespace or anything.", 'start': 1457.612, 'duration': 2.52}, {'end': 1461.452, 'text': "And I don't want to call it hash table entry.", 'start': 1460.152, 'duration': 1.3}, {'end': 1463.393, 'text': 'It fits perfectly inside this class.', 'start': 1461.472, 'duration': 1.921}, {'end': 1466.493, 'text': "Again, I'm just using this as a bit of an organizational thing.", 'start': 1463.853, 'duration': 2.64}], 'summary': 'Creating an entry struct within the hash table class for organizational purposes.', 'duration': 24.475, 'max_score': 1442.018, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY1442018.jpg'}, {'end': 1528.256, 'src': 'embed', 'start': 1499.86, 'weight': 5, 'content': [{'end': 1502.161, 'text': 'So entry creates 26 of these.', 'start': 1499.86, 'duration': 2.301}, {'end': 1503.682, 'text': 'they get initialized with never used.', 'start': 1502.161, 'duration': 1.521}, {'end': 1508.224, 'text': 'So technically speaking, we should already have 26 never used entries just by doing this.', 'start': 1503.842, 'duration': 4.382}, {'end': 1510.485, 'text': "We don't need to manually iterate through everything.", 'start': 1508.524, 'duration': 1.961}, {'end': 1516.929, 'text': "And to kind of, you know, demonstrate this, I'm going to write a print function, which we need anyway, because the output needs to be that.", 'start': 1510.925, 'duration': 6.004}, {'end': 1522.312, 'text': "And that's basically going to go through and just output all of the entries that we actually have.", 'start': 1517.369, 'duration': 4.943}, {'end': 1528.256, 'text': "But for now, what I'm going to do is actually go through every entry and just print everything, mostly for debugging.", 'start': 1522.532, 'duration': 5.724}], 'summary': 'Initializing 26 entries automatically, avoiding manual iteration for output.', 'duration': 28.396, 'max_score': 1499.86, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY1499860.jpg'}, {'end': 1639.878, 'src': 'embed', 'start': 1614.712, 'weight': 6, 'content': [{'end': 1620.874, 'text': "So we don't actually need these, cause I'm just gonna call hash table dot add, and then I wanna pass in the entry name.", 'start': 1614.712, 'duration': 6.162}, {'end': 1626.935, 'text': "So we have add and delete, could call this insert, but we'll call it add for A.", 'start': 1621.054, 'duration': 5.881}, {'end': 1628.755, 'text': "And let's write these functions.", 'start': 1626.935, 'duration': 1.82}, {'end': 1630.916, 'text': 'So up over here, void add.', 'start': 1628.915, 'duration': 2.001}, {'end': 1639.878, 'text': "Now we're using okay, so I probably would take this in as some kind of string view, but since we are using C++ 11, which doesn't have that,", 'start': 1631.356, 'duration': 8.522}], 'summary': 'Developing functions for hash table operations in c++ 11.', 'duration': 25.166, 'max_score': 1614.712, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY1614712.jpg'}], 'start': 1326.78, 'title': 'Using std string constructor and creating a hash table class', 'summary': "Discusses utilizing the std string constructor to handle const char pointers and creating a hash table class with 26 slots, initializing entries with 'never used', and implementing functions to add or delete entries.", 'chapters': [{'end': 1364.824, 'start': 1326.78, 'title': 'Using std string constructor for const char pointer', 'summary': 'Discusses using the constructor of std string that takes a const char pointer to achieve the same result as using a string buffer and considers leaving it as a substring for better understanding.', 'duration': 38.044, 'highlights': ['Using the constructor of std string that takes in a const char pointer to achieve the same result as using a string buffer.', 'Considering leaving it as substring for better understanding.']}, {'end': 1652.903, 'start': 1364.984, 'title': 'Creating a hash table class', 'summary': "Discusses creating a hash table class with 26 slots, initializing entries with 'never used', and implementing functions to add or delete entries.", 'duration': 287.919, 'highlights': ['Creating a class for the hash table to organize the code and keep it clean. The speaker discusses organizing the hash table under a class for cleanliness and organization.', "Initializing 26 slots with the status of 'never used' using a static const int in the hash table namespace. The speaker explains the process of initializing 26 slots with the status of 'never used' using a static const int in the hash table namespace.", "Discussing the creation of an 'entry' struct to store data and status for each entry in the hash table. The speaker talks about creating an 'entry' struct within the hash table class to store data and status for each entry.", "Demonstrating the initialization of entries with 'never used' and debugging by printing all entries. The speaker demonstrates the initialization of entries with 'never used' and debugging by printing all entries.", 'Planning to implement functions to add or delete entries in the hash table. The speaker plans to implement functions to add or delete entries in the hash table.']}], 'duration': 326.123, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY1326780.jpg', 'highlights': ['Using the constructor of std string that takes in a const char pointer to achieve the same result as using a string buffer.', 'Considering leaving it as substring for better understanding.', 'Creating a class for the hash table to organize the code and keep it clean.', "Initializing 26 slots with the status of 'never used' using a static const int in the hash table namespace.", "Discussing the creation of an 'entry' struct to store data and status for each entry in the hash table.", "Demonstrating the initialization of entries with 'never used' and debugging by printing all entries.", 'Planning to implement functions to add or delete entries in the hash table.']}, {'end': 2206.088, 'segs': [{'end': 1735.428, 'src': 'embed', 'start': 1710.982, 'weight': 2, 'content': [{'end': 1716.804, 'text': "And I guess what we'll do is we'll just accept in a string and we'll get back the index into this array that it should belong to.", 'start': 1710.982, 'duration': 5.822}, {'end': 1723.566, 'text': 'So how do we calculate the index? Well, the hash function, remember, is just the last character of the string.', 'start': 1717.184, 'duration': 6.382}, {'end': 1726.767, 'text': 'So entry string dot back gets us the very last character.', 'start': 1723.646, 'duration': 3.121}, {'end': 1730.848, 'text': 'No need to do something like entry string, entry string dot size minus one.', 'start': 1726.807, 'duration': 4.041}, {'end': 1735.428, 'text': 'You can just use the dot back function and it will get you the last character of that entry string.', 'start': 1731.168, 'duration': 4.26}], 'summary': 'The hash function uses the last character of the string to calculate the index for an array.', 'duration': 24.446, 'max_score': 1710.982, 'thumbnail': ''}, {'end': 1865.492, 'src': 'embed', 'start': 1837.195, 'weight': 0, 'content': [{'end': 1843.38, 'text': "So now that we've done this hash value key thing, find the first try the corresponding table slot.", 'start': 1837.195, 'duration': 6.185}, {'end': 1844.881, 'text': "If the key's there, we found it.", 'start': 1843.46, 'duration': 1.421}, {'end': 1846.702, 'text': "If it's never used, it doesn't exist.", 'start': 1845.261, 'duration': 1.441}, {'end': 1848.543, 'text': 'So we can return false from our find function.', 'start': 1846.742, 'duration': 1.801}, {'end': 1851.806, 'text': 'If the key is occupied or tombstone, then move to the next slot.', 'start': 1848.924, 'duration': 2.882}, {'end': 1856.088, 'text': "and keep trying until the key is found or we're certain it doesn't exist.", 'start': 1852.726, 'duration': 3.362}, {'end': 1856.828, 'text': 'Pretty simple.', 'start': 1856.228, 'duration': 0.6}, {'end': 1865.492, 'text': "So all we have to really do is go through basically every slot, check to see if it's actually is equal to the string that we're trying to search for.", 'start': 1857.188, 'duration': 8.304}], 'summary': 'Using hash table, search for key by checking through every slot until found or confirmed non-existent.', 'duration': 28.297, 'max_score': 1837.195, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY1837195.jpg'}, {'end': 2015.632, 'src': 'embed', 'start': 1989.27, 'weight': 1, 'content': [{'end': 1993.514, 'text': 'so the first step is try is to try and see if the key exists.', 'start': 1989.27, 'duration': 4.244}, {'end': 1994.275, 'text': "if we're inserting.", 'start': 1993.514, 'duration': 0.761}, {'end': 2000.16, 'text': 'uh, if it does do nothing, okay, otherwise take the last character of the key as the hash value.', 'start': 1994.275, 'duration': 5.885}, {'end': 2002.262, 'text': 'obviously we have our get index function.', 'start': 2000.16, 'duration': 2.102}, {'end': 2006.566, 'text': 'if that slot is not occupied, put the key there and occupy the slot.', 'start': 2002.262, 'duration': 4.304}, {'end': 2008.787, 'text': 'If it is occupied, try the next slot.', 'start': 2006.706, 'duration': 2.081}, {'end': 2011.129, 'text': "So immediately let's implement the first stage of that.", 'start': 2009.047, 'duration': 2.082}, {'end': 2013.911, 'text': "Let's go ahead and just write a boolean called exists.", 'start': 2011.97, 'duration': 1.941}, {'end': 2015.632, 'text': "We'll call find on entry string.", 'start': 2013.931, 'duration': 1.701}], 'summary': 'Implementing key existence check and hash value generation for insertion.', 'duration': 26.362, 'max_score': 1989.27, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY1989270.jpg'}], 'start': 1653.303, 'title': 'Hash table operations', 'summary': 'Covers implementing add and delete functions, utilizing ascii values to calculate index, emphasizing adherence to assignment requirements, and explaining hash table insertion algorithm with search, insertion process, while loop, and get insert index function.', 'chapters': [{'end': 1836.855, 'start': 1653.303, 'title': 'Implementing add and delete functions', 'summary': 'Explains the process of implementing a hash function to add entries, utilizing ascii values to calculate the index, and emphasizes the importance of adhering to the assignment requirements.', 'duration': 183.552, 'highlights': ['The process of implementing a hash function to add entries involves taking the last character of the entry as the hash value and using ASCII values to calculate the index, ensuring that the function adheres to the assignment requirements (e.g., using lowercase letters only) to prevent potential crashes.', 'Emphasizing the importance of adhering to the assignment requirements, such as utilizing lowercase letters only, to prevent potential crashes when implementing the hash function.', 'Detailing the utilization of ASCII values to calculate the index for the hash function, with examples demonstrating the subtraction of 97 from the ASCII value of the characters to determine the correct index within the array.']}, {'end': 2206.088, 'start': 1837.195, 'title': 'Hash table insertion algorithm', 'summary': 'Explains the process of searching for and inserting a key into a hash table, where the search is conducted through each slot and the insertion index is determined based on the status of the slots, using a while loop and a get insert index function.', 'duration': 368.893, 'highlights': ["The process of searching for a key in a hash table involves checking every slot to see if it's equal to the string being searched for and returning true if found, false if never used, and moving to the next slot if occupied or tombstone. ", 'The insertion index for a new key is determined by running the get insert index function, which finds the first available slot for insertion based on the status of the slots (never used or tombstone), and then setting the data and status at that index to the new entry string and occupied, respectively. ', 'The process uses a while true loop to iterate through the slots and compares string characters for equality, with a consideration that the index needs to be able to wrap around the size of the table for incrementing. ']}], 'duration': 552.785, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY1653303.jpg', 'highlights': ["The process of searching for a key in a hash table involves checking every slot to see if it's equal to the string being searched for and returning true if found, false if never used, and moving to the next slot if occupied or tombstone.", 'The insertion index for a new key is determined by running the get insert index function, which finds the first available slot for insertion based on the status of the slots (never used or tombstone), and then setting the data and status at that index to the new entry string and occupied, respectively.', 'The process of implementing a hash function to add entries involves taking the last character of the entry as the hash value and using ASCII values to calculate the index, ensuring that the function adheres to the assignment requirements (e.g., using lowercase letters only) to prevent potential crashes.']}, {'end': 3000.824, 'segs': [{'end': 2268.65, 'src': 'embed', 'start': 2229.183, 'weight': 0, 'content': [{'end': 2232.684, 'text': 'And then strawberry is occupied at the Y slot because this is obviously Z.', 'start': 2229.183, 'duration': 3.501}, {'end': 2233.684, 'text': 'So looks pretty good.', 'start': 2232.684, 'duration': 1}, {'end': 2238.966, 'text': "Obviously, deleting doesn't work, but I think we were able to validly, kind of validly, I don't know if that's a word.", 'start': 2233.785, 'duration': 5.181}, {'end': 2243.289, 'text': 'we were able to insert properly all of our kind of elements that we tried to.', 'start': 2239.606, 'duration': 3.683}, {'end': 2245.03, 'text': "Let's make delete work.", 'start': 2243.689, 'duration': 1.341}, {'end': 2257.398, 'text': 'So what does delete do? So delete basically does something similar to this, right? I mean, it tries to find whether or not this entry string exists.', 'start': 2245.99, 'duration': 11.408}, {'end': 2260.16, 'text': "If it doesn't exist, then we return because there's nothing to delete.", 'start': 2257.458, 'duration': 2.702}, {'end': 2265.326, 'text': 'But otherwise, we need to actually find the index of that actual entry.', 'start': 2260.58, 'duration': 4.746}, {'end': 2268.65, 'text': 'So this is where I am actually going to modify the find function.', 'start': 2266.127, 'duration': 2.523}], 'summary': 'Discussion about modifying find function for delete operation.', 'duration': 39.467, 'max_score': 2229.183, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY2229183.jpg'}, {'end': 2427.852, 'src': 'embed', 'start': 2401.068, 'weight': 1, 'content': [{'end': 2405.553, 'text': "And obviously if it's Tombstone, when we write our print function properly, it's not gonna print it.", 'start': 2401.068, 'duration': 4.485}, {'end': 2408.597, 'text': "It's only gonna print occupied slots.", 'start': 2405.633, 'duration': 2.964}, {'end': 2411.72, 'text': "So we don't really need to worry about wasting time.", 'start': 2408.877, 'duration': 2.843}, {'end': 2413.462, 'text': 'changing the data.', 'start': 2412.781, 'duration': 0.681}, {'end': 2415.263, 'text': "That's kind of it.", 'start': 2414.122, 'duration': 1.141}, {'end': 2424.049, 'text': "The one thing I will do to these two functions is I'm going to change the if statements because at the moment I mean we have a return here and we also return,", 'start': 2415.823, 'duration': 8.226}, {'end': 2425.43, 'text': 'obviously, when we get to the end of the function.', 'start': 2424.049, 'duration': 1.381}, {'end': 2427.852, 'text': 'Multiple function returns can be a little bit confusing.', 'start': 2425.77, 'duration': 2.082}], 'summary': 'Improving the print function to only print occupied slots and addressing multiple function returns.', 'duration': 26.784, 'max_score': 2401.068, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY2401068.jpg'}, {'end': 2689.911, 'src': 'embed', 'start': 2645.973, 'weight': 4, 'content': [{'end': 2650.538, 'text': 'i think this code is a lot cleaner than, uh, the code that we obviously reviewed last time,', 'start': 2645.973, 'duration': 4.565}, {'end': 2655.319, 'text': 'And hopefully you learned a thing or two by watching me do this assignment.', 'start': 2651.078, 'duration': 4.241}, {'end': 2662.44, 'text': "Now, before we actually claim that we've done it, let's take a look at the test cases because I also have access to those.", 'start': 2655.619, 'duration': 6.821}, {'end': 2669.702, 'text': 'So these over here are the actual test cases that were given to everyone doing the assignment.', 'start': 2662.8, 'duration': 6.902}, {'end': 2672.182, 'text': 'First of all, I mean you can.', 'start': 2670.002, 'duration': 2.18}, {'end': 2678.825, 'text': "I don't want to like roll the ball, we'll say on anyone here, but like The effort that has gone into, this assignment is so little.", 'start': 2672.182, 'duration': 6.643}, {'end': 2680.225, 'text': "I mean, there's just random characters.", 'start': 2678.905, 'duration': 1.32}, {'end': 2681.646, 'text': 'Like one of these has actual words.', 'start': 2680.246, 'duration': 1.4}, {'end': 2685.609, 'text': "Anyway, so let's go ahead and I mean, I'm not gonna do all of these.", 'start': 2682.587, 'duration': 3.022}, {'end': 2689.911, 'text': "Let's go ahead and maybe do this one and see if we get the expected output.", 'start': 2685.649, 'duration': 4.262}], 'summary': 'Code review revealed cleaner code and subpar test cases, prompting further evaluation.', 'duration': 43.938, 'max_score': 2645.973, 'thumbnail': ''}, {'end': 2799.795, 'src': 'embed', 'start': 2775.779, 'weight': 3, 'content': [{'end': 2783.564, 'text': 'So a couple of things that I noticed while editing this actually is, I mean, for a lot of these functions, I could have definitely made them const.', 'start': 2775.779, 'duration': 7.785}, {'end': 2785.885, 'text': "It's a little thing, but it's usually something that I like to do.", 'start': 2783.764, 'duration': 2.121}, {'end': 2787.546, 'text': 'I just forgot to do it.', 'start': 2786.565, 'duration': 0.981}, {'end': 2790.168, 'text': "So obviously, these don't actually modify the state.", 'start': 2788.266, 'duration': 1.902}, {'end': 2793.81, 'text': "So it's fine to kind of make them const.", 'start': 2790.208, 'duration': 3.602}, {'end': 2799.795, 'text': "And then the other thing was if we're really being kind of pedantic and we should be to be honest,", 'start': 2794.13, 'duration': 5.665}], 'summary': 'Functions could have been made const, do not modify state.', 'duration': 24.016, 'max_score': 2775.779, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY2775779.jpg'}, {'end': 2962.716, 'src': 'heatmap', 'start': 2928.568, 'weight': 1, 'content': [{'end': 2936.114, 'text': "So if we go back over here, let's compile this and run it and let's try this input because I don't think we tried this one.", 'start': 2928.568, 'duration': 7.546}, {'end': 2940.698, 'text': "So if I paste this in, I mean, I guess it'll be hard to say if we actually have a trailing space.", 'start': 2936.795, 'duration': 3.903}, {'end': 2941.699, 'text': 'but you can.', 'start': 2941.218, 'duration': 0.481}, {'end': 2947.604, 'text': "i guess you can see over here that, um, it doesn't look like there's a trailing space and this, of course,", 'start': 2941.699, 'duration': 5.905}, {'end': 2950.966, 'text': 'should be the correct output and you can see that it is okay.', 'start': 2947.604, 'duration': 3.362}, {'end': 2952.428, 'text': 'so i hope you guys enjoyed this video.', 'start': 2950.966, 'duration': 1.462}, {'end': 2954.73, 'text': "if you did, please don't forget to hit the like button below.", 'start': 2952.428, 'duration': 2.302}, {'end': 2958.453, 'text': 'let me know what you thought of this kind of uh video.', 'start': 2954.73, 'duration': 3.723}, {'end': 2962.716, 'text': "i mean it's not something i've really ever done before, so i'm definitely interested in your feedback.", 'start': 2958.453, 'duration': 4.263}], 'summary': 'Testing for trailing space in input, correct output confirmed.', 'duration': 34.148, 'max_score': 2928.568, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY2928568.jpg'}], 'start': 2206.793, 'title': 'Implementing and testing functions in c++', 'summary': 'Discusses implementing insert and delete functions in c++, including modifying the find function, marking deleted entries as tombstone, and testing with examples. it also involves refactoring code, resulting in about 100 lines of improved code and successful test cases.', 'chapters': [{'end': 2561.038, 'start': 2206.793, 'title': 'Implementing insert and delete functions', 'summary': 'Discusses the implementation of insert and delete functions in c++, including modifying the find function to return an index, marking the status of deleted entries as tombstone, and testing the functionality with example cases.', 'duration': 354.245, 'highlights': ['Marking deleted entries as tombstone The function marks the status of the deleted entry as tombstone, without clearing the data, ensuring that the print function will only display occupied slots, minimizing time wasted on changing data.', 'Modifying the find function to return an index The find function is modified to return an index of the entry string, providing more information and allowing for efficient deletion and manipulation of data.', 'Testing the functionality with example cases The functionality of insert and delete functions is tested using example cases, ensuring that the operations of adding, deleting, and re-adding elements are accurately reflected in the data structure.']}, {'end': 3000.824, 'start': 2561.118, 'title': 'Refactoring code and testing output', 'summary': 'Involves refactoring code to ensure it is formatted correctly, running test cases, and achieving the expected output, resulting in an improved code with about 100 lines and successful test cases, while also highlighting areas for potential improvement.', 'duration': 439.706, 'highlights': ['The effort put into the assignment is minimal, with random characters in test cases, but the code manages to produce the expected output. 8', 'The code review highlighted potential improvements, such as making functions const and addressing trailing space in the output. 7', 'The code is cleaner and more efficient, taking about 100 lines to complete, compared to the previous code reviewed. 6']}], 'duration': 794.031, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/kQsHF7C-FUY/pics/kQsHF7C-FUY2206793.jpg', 'highlights': ['Modifying the find function to return an index The find function is modified to return an index of the entry string, providing more information and allowing for efficient deletion and manipulation of data.', 'Marking deleted entries as tombstone The function marks the status of the deleted entry as tombstone, without clearing the data, ensuring that the print function will only display occupied slots, minimizing time wasted on changing data.', 'Testing the functionality with example cases The functionality of insert and delete functions is tested using example cases, ensuring that the operations of adding, deleting, and re-adding elements are accurately reflected in the data structure.', 'The code review highlighted potential improvements, such as making functions const and addressing trailing space in the output.', 'The code is cleaner and more efficient, taking about 100 lines to complete, compared to the previous code reviewed.', 'The effort put into the assignment is minimal, with random characters in test cases, but the code manages to produce the expected output.']}], 'highlights': ["The YouTuber plans to rewrite a real second-year university assignment in a 'code review' video on their channel, based on an assignment related to data algorithms and patterns.", 'Skillshare offers a wide range of courses, from creative subjects like videography, photography, and editing to business and marketing, catering to millions of users worldwide.', 'Skillshare provides a one month free trial for the first 1000 users, allowing ample time to explore the platform and its courses, emphasizing its cost-effectiveness and user-friendly approach.', 'The video is sponsored by Skillshare, a key point to note as it influences the content and provides context for the audience.', 'The hash table contains exactly 26 slots, A to Z, designed for efficient search and insertion operations, with emphasis on collision management and the potential scenarios for slot usage.', 'The assignment requires the implementation of a very specific hash table for storing 26 English words, focusing on lowercase words with a maximum length of 10 characters and using the last character as the hash function.', 'The insertion process includes performing a search to check for key existence, taking the last character of the key as the hash value, and putting the key in an unoccupied slot, with provisions for collision management by trying the next slot until a free one is found.', 'The searching process involves taking the last character of the key as the hash value and trying the corresponding table slot, followed by moving to the next slot if the current one is occupied or a tombstone, with the possibility of wrapping the table if needed.', 'Compiler requirements for the assignment The code is compiled using G++ with C++ 11, optimization two, warning as all, and the main.cpp file is to be provided, ensuring compliance with the mentioned requirements.', 'Creating a batch file named build.bat to simplify the compilation process', "The process of searching for a key in a hash table involves checking every slot to see if it's equal to the string being searched for and returning true if found, false if never used, and moving to the next slot if occupied or tombstone.", 'The insertion index for a new key is determined by running the get insert index function, which finds the first available slot for insertion based on the status of the slots (never used or tombstone), and then setting the data and status at that index to the new entry string and occupied, respectively.', 'Modifying the find function to return an index The find function is modified to return an index of the entry string, providing more information and allowing for efficient deletion and manipulation of data.']}