You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Oakton CSC-240-0C1 section 3.7 https://runestone.academy/ns/books/published/CSC-240-0C1-CPlusPlusDS-OaktonCollege-Spring2025/LinearBasic/BalancedSymbolsGeneralCase.html the example code in C++ doesn't work as intended because it doesn't check the index of the open symbol against the index of the closed symbol in matches(), only that there is an opening symbol to pair with the closing symbol. The Python implementation does check index, and so doesn't suffer this bug. This can be confirmed as a C++ only bug by testing "( [ ) ]" in each language; C++ sees it as a pass, because it isn't checking parentheses versus brackets, whereas Python fails it. Images attached with only my test line added to each language - code is otherwise unaltered from what is presented as the example.
The text was updated successfully, but these errors were encountered:
In Oakton CSC-240-0C1 section 3.7 https://runestone.academy/ns/books/published/CSC-240-0C1-CPlusPlusDS-OaktonCollege-Spring2025/LinearBasic/BalancedSymbolsGeneralCase.html the example code in C++ doesn't work as intended because it doesn't check the index of the open symbol against the index of the closed symbol in matches(), only that there is an opening symbol to pair with the closing symbol. The Python implementation does check index, and so doesn't suffer this bug. This can be confirmed as a C++ only bug by testing "( [ ) ]" in each language; C++ sees it as a pass, because it isn't checking parentheses versus brackets, whereas Python fails it. Images attached with only my test line added to each language - code is otherwise unaltered from what is presented as the example.
The text was updated successfully, but these errors were encountered: