{"id":17606562,"url":"https://github.com/mhahsler/cs2341","last_synced_at":"2026-03-10T02:31:24.025Z","repository":{"id":37490400,"uuid":"505563095","full_name":"mhahsler/CS2341","owner":"mhahsler","description":"Code Examples for Data Structures with C++","archived":false,"fork":false,"pushed_at":"2024-05-08T15:15:49.000Z","size":11535,"stargazers_count":17,"open_issues_count":0,"forks_count":21,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-30T11:12:58.498Z","etag":null,"topics":["cpp","data-structures"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mhahsler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-20T18:56:00.000Z","updated_at":"2025-04-21T03:25:18.000Z","dependencies_parsed_at":"2024-05-08T16:57:09.855Z","dependency_job_id":null,"html_url":"https://github.com/mhahsler/CS2341","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mhahsler/CS2341","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhahsler%2FCS2341","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhahsler%2FCS2341/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhahsler%2FCS2341/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhahsler%2FCS2341/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mhahsler","download_url":"https://codeload.github.com/mhahsler/CS2341/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhahsler%2FCS2341/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30322645,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T01:36:58.598Z","status":"online","status_checked_at":"2026-03-10T02:00:06.579Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","data-structures"],"created_at":"2024-10-22T15:44:49.721Z","updated_at":"2026-03-10T02:31:24.002Z","avatar_url":"https://github.com/mhahsler.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"images/DS_Weiss_Book.jpg\" align=\"right\"\u003e Code Examples for Data Structures\n\nThis course is designed by [Michael Hahsler](https://michael.hahsler.net/) \nfor learning basic data structures, their implementation\nfor current hardware, and their performance tradeoffs.  We will use C++, a\nlanguage widely used to implement performance-critical components of\napplications.  C++ provides access to low-level memory management facilities\nand is therefore well-suited for learning about data structures and their\nefficient implementations. It will provide the basis for understanding the\nimpact of the used data structures on memory consumption and runtime.  This\nknowledge is especially important when using managed programming languages like\nJava or Python which hide important aspects from the programmer.\n\n**Textbook:** Data Structures and Algorithm Analysis in C++ (Fourth Edition), by Mark Allen Weiss.\nSource Code by Mark Allen Weiss can be found [here.](https://users.cs.fiu.edu/~weiss/dsaa_c++4/code/)\n\n## Preparation for this course \n\nThis course assumes that you know the basics of C++ programming, object-oriented design, and memory management from\nan introductory C++ course. To make sure you are ready, work through [HOWTO prepare for this data structures course](HOWTO_prepare_for_data_structures.md).\n\n## Course Material\n\n| Book Chapter | Lecture Notes and Code                            |\n| :----------: | :------------------------------------------------ |\n|      1       | [Programming](Chapter1_Programming)               |\n|      2       | [Algorithm Analysis](Chapter2_Algorithm_Analysis) |\n|      3       | [Lists, Stacks, and Queues](Chapter3_Lists_etc)   |\n|      4       | [Trees](Chapter4_Trees)                           |\n|      5       | [Hashing](Chapter5_Hashing)                       |\n|      6       | [Heaps](Chapter6_Heaps)                           |\n|      7       | [Sorting](Chapter7_Sorting)                       |\n|      9       | [Graphs](Chapter9_Graphs)                         |\n\nCode developed in class can be found in the [CS2341_Scratch repository.](https://github.com/mhahsler/CS2341_Scratch)\n\nCourse material and assignments for CS 2341 at SMU can be found on [Canvas](https://www.smu.edu/OIT/Services/Canvas/).\n\n\n\n## Required Tools\n\n### Installation on your own computer\n* Install [Visual Studio Code](https://code.visualstudio.com/) (VS Code)\n* Install compilers and `cmake`:\n    - On **Linux** you most likely have already everything you need installed (`gcc`, `cmake`, `valgrind`). If not, \n      then install the missing packages using your package manager (e.g., on Ubuntu using `sudo apt-get install build-essential cmake valgrind`). \n    - On **Windows** you will need to [install WSL](https://code.visualstudio.com/docs/cpp/config-wsl) and use the VS Code remote-WSL Extension. You also need to install `cmake` and `valgrind` using the WSL shell (`sudo apt-get install build-essential cmake valgrind`). You will always need to open folders by clicking on the green `\u003e\u003c` at the bottom left corner of VS Code and select open folder in WSL.\n    - On **MacOS** you need to install [clang](https://code.visualstudio.com/docs/cpp/config-clang-mac) and \n      set up the path using [shell command](https://code.visualstudio.com/docs/setup/mac). You also need to install [cMake](https://cmake.org/install/) (follow the instructions carefully and set the PATH). \n      An installation option is [Homebrew](https://brew.sh/).\n* Install [git](https://git-scm.com/) and then you can use the [VS Code integration](https://code.visualstudio.com/docs/editor/versioncontrol).\n* Install [VS Code extensions for C++ and CMake](https://code.visualstudio.com/docs/languages/cpp). \n  The extensions are: `C/C++`, `C/C++ Extension Pack`, `CMake Tools`. VS Code will prompt you to install these. Make sure that you install the extensions **after** you have the software above installed or it might not find it during setting up the extension. \n\n\n### Using VS Code With a Remote Linux Server\nIf you have access to a linux host server with all development tools installed (see [Genuse servers](https://www.smu.edu/OIT/Services/genuse) for SMU students) then you can work on the server by installing only VS Code and the VS Code extension `Remote - SSH` on your computer. You can then connect to the linux host by clicking on the green `\u003e\u003c` at the bottom left corner of VS Code ([details](https://code.visualstudio.com/docs/remote/ssh)). \nThis is a good option if certain tools\nare not available for your computer architecture (e.g., `valgrind` is not available for MacOS with M1 and M2 processors).\nDetails on how to use ssh and the shell can be found below.\n\n\n## HOWTOs\n* [HOWTO prepare for this data structures course](HOWTO_prepare_for_data_structures.md)\n* [GitHub Quickstart](https://docs.github.com/en/get-started/quickstart)\n* [HOWTO Use a Shell and SSH](HOWTO_shell_and_ssh.md)\n* [HOWTO Compile Programs With VS Code and CMake](HOWTO_compile_programs_with_CMake.md)\n* [HOWTO Good Coding Practice](HOWTO_good_coding_practice.md)\n* [HOWTO Debug](HOWTO_debug.md)\n* [HOWTO Detect Memory Leaks](HOWTO_detect_memory_leaks.md)\n* [HOWTO Test](HOWTO_test.md)\n* [HOWTO Profile Code](HOWTO_profile_code.md)\n\n\n## License\n\n\u003cimg src=\"https://licensebuttons.net/l/by-sa/3.0/88x31.png\" alt=\"CC BY-SA 4.0\" align=\"left\"\u003e\n\nAll code and documents in this repository are provided under [Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) License.](https://creativecommons.org/licenses/by-sa/4.0/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhahsler%2Fcs2341","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmhahsler%2Fcs2341","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhahsler%2Fcs2341/lists"}