Data Structures

Fall 2023 ECE 36800 :: Purdue University


Course information
ECE 36800 - Data Structures - 3 credits
Section 3 - CRN 26543 - Tue/Thu 1:30-2:45pm - BHEE 170
Section 1 - CRN 26418 - Tue/Thu 3:00-4:15pm - BHEE 170

Prerequisite: CS 26400 with a minimum grade of C

Course description “Provides insight into the use of data structures. Topics include stacks, queues and lists, trees, graphs, sorting, searching, and hashing.” (official catalog description)
Instructor Alexander J. Quinn
MSEE 262 - 765-494-3483 -
Office hours: Mon/Wed 3:00-4:30pm in MSEE 262
Learning Resources, Technology & Texts


  • Algorithms in C, Parts 1-4: Fundamentals, Data Structures, Sorting, Searching, 3rd Edition, Robert Sedgewick, Addison Wesley, 1999, ISBN 9780201314526
  • Algorithms in C, Part 5: Graph Algorithms, 3rd Edition, Robert Sedgewick, Addison Wesley, 2002, ISBN 9780201316636

We will direct you to the appropriate sections of the book so that you can prepare for class and strengthen your understanding of concepts and practical issues. However, we will not assign exercises from the book. Depending on your learning style and ability to find resources online, you may be able to get through the course without purchasing the textbook.

Software/web resources

You will access course resources through a computer cluster known as eceprog. To access eceprog, you will use PuTTY (Windows) or Terminal (Mac or Linux).

Most information will be available through the course web site:

Hardware requirements

You can access the course resources using any computer.

Tutoring support

TAs will be available for one-to-one assistance learning concepts necessary to complete homework and assessing code quality. TAs will not assist in ways that deprive students of the opportunity to learn problem-solving skills. In other words, they will not debug your code or guide you to a solution to a homework.

Brightspace learning management system

We will not use Brightspace, except as a path to access recorded lecture videos (Boilercast).

Topics Lectures and assignments cover the following topics:
  1. Complexity
  2. Linked lists (more techniques and algorithms than ECE 26400)
  3. Stacks
  4. Recursion (more depth than ECE 26400)
  5. Queues
  6. Trees - balanced binary search trees (BSTs), Btrees, red-black trees, etc.
  7. Sorting - Heap sort, quick sort, merge sort, radix sort
  8. Hash tables
  9. Searching algorithms
  10. Graphs - topological sort, shortest path, etc.
  11. Programming interview preparation
Learning outcomes

Learning objectives

This course is designed to ensure that every student who passes will have mastered the following learning objectives:
  1. An understanding of various basic data structures, including stacks, queues, and trees.
  2. An ability to analyze time complexity and space complexity of algorithms.
  3. An ability to apply appropriate sorting and searching algorithms for a given application.
  4. An ability to apply graph theoretic techniques, data structures and algorithms for problem solving.
  5. An ability to design and implement appropriate data structures and algorithms for engineering applications.

These learning objectives form the backbone for the content in this course. However, they do not pose an additional requirement for passing. Grades are determined solely by the formula in the section below.


Your achievement of course learning outcomes will be assessed by way of homework (30%), exam #1 (5%), exam #2 (10%), exam #3 (15%), lesser of your exam total or your homework average (20%), in-class quizzes and exercises (20%), and participation. Homework deadlines will be listed on the course web site. Quizzes and in-class exercises may or may not be announced in advance. (Attendance is required.)

Update (12/1/2023): We will weight the exams either 5%/10%/15%, or 10%/10%/10%, whichever is highest. This change can only help you.

Homework assignments will be weighted equally, except that HW05 will be worth half as much as a regular homework, and HW06 will be worth 1.5x as much. (Together, the two were given 2 weeks but as stated in class, btree_query.c was intended as a warm-up to help you get ready for btree_delete.c.)

Grades Grades for this semester will be calculated based on the following components:
30% Homework − weighted average
5% Exam #1
10% Exam #2
15% Exam #3
20% Either: exams (total) −OR− homework (weighted average), which ever is less
20% In-class quizzes and exercises

As a starting point, homework difficulty is presumed to be proportional to the number of calendar days you had to do the assignment, excluding official university holidays. Weights may be adjusted if it would improve fairness and/or help the class, at the instructor's discretion. For example, if a deadline is moved for reasons unrelated to the difficulty (e.g., holidays, technical problems, etc.), the weight would not change.

Update 12/1/2023: HW01, HW02, HW03, HW04, and HW07 will be weighted equally. HW05 will be worth half as much as those, while HW06 will be worth 1.5 as much (as HW01, …). Together, they had two weeks (not counting break), but since btree_query.c was just a warm-up (explained in class) for btree_delete.c (the real work), HW06 should have most of their combined weight. In other words, to calculate your weighted homework average: (hw1 + hw2 + hw3 + hw4 + 0.5*hw5 + 1.5*hw6 + hw7) / 7.

Your letter grade is then found according to the following correspondence: S ≥ 80 ⇒ A,   S ≥ 77 ⇒ A–,   S ≥ 73 ⇒ B+,   S ≥ 70 ⇒ B,   S ≥ 67 ⇒ B–,   S ≥ 63 ⇒ C+,   S ≥ 60 ⇒ C,   S ≥ 57 ⇒ C–,   S ≥ 55 ⇒ D+,   S ≥ 53 ⇒ D,   S ≥ 50 ⇒ D–,   S ≥ 0 ⇒ F. 

A+ will be assigned to those who meet the criteria for an A and meet any of the following criteria:

  • Outstanding participation in ways that benefit other students and that your instructor can observe.
  • Among top 2% of students in the course by overall performance.

We expect to convert at least 20% of the A grades to A+. If many demonstrate excellent participation, this may be increased to as much as 50% of the A's.

Quizzes will be given in class.

Contingency plan for in-class quizzes and exercises administration. If administering in-class quizzes and/or exercises becomes logistically difficult, we reserve the right to either replace those with online exercises or reduce the quantity and their contribution to your final grade.

You may earn extra credit through exemplary participation and/or bonus options on some homework assignments (if any).
  • Bonus points can be earned through optional "bonus" options in certain assignments. Each participation point is worth 1% of extra credit. The number is not preset. Bonus points are capped at 10 bonus points per person.
  • Participation points can be earned by demonstrating exemplary engagement with the course. Each participation point is worth 1% extra credit. The default is 0. The maximum is 10, and is very rare (i.e., only for extreme engagement and dedication throughout the semester). Participation will be assessed by your instructor at the end of the semester, based on any of the following:
    • helping other students in online discussions
    • asking insightful questions in class or instructor office hours
    • being first to report significant issues in homework assignments via the homework bug bounty
    • contributing to the class in other tangible ways

Bonus and participation points are optional, and not part of the denominator when calculating your grade. It is possible to achieve an A+ without any bonus or participation points.


Attendance in-person is required. This is not an online course.

There will be lecture exercises and quizzes (announced and unannounced).

Boilercast recordings will usually be available, but are not guaranteed. There may sometimes be technical issues. Watching Boilercast recordings is not an acceptable substitute for attending class, except for cases of illness, schedule conflicts with Purdue-sponsored events, and similarly unavoidable circumstances.

If you cannot attend in-person due to such circumstances, it is your responsibility to do the following:

  1. Email the instructor with subject line “Absence from lecture - ECE 36800” by 1:30 PM on the day of the lecture. If there is lecture exercise or quiz, we will allow you to make it up. If we cannot find a way to do that, we may opt to factor it out of your grade.
  2. Watch the recorded lecture, if available. If a recording is not available, contact the course staff by posting on Piazza. (A private post to course staff only is okay, if you prefer.)

Students are expected to be present for every meeting of the classes in which they are enrolled. Only the instructor can excuse a student from a course requirement or responsibility. When conflicts or absences can be anticipated, such as for many University sponsored activities and religious observations, the student should inform the instructor of the situation as far in advance as possible…For unanticipated or emergency absences when advance notification to an instructor is not possible, the student should contact the instructor as soon as possible by email, or by contacting the main office that offers the course. When the student is unable to make direct contact with the instructor and is unable to leave word with the instructor’s department because of circumstances beyond the student’s control, and in cases of bereavement, the student or the student’s representative should contact the Office of the Dean of Students.

Email The course staff are here to help you become a great C programmer. We will provide help with general questions during lab hours, instructor office hours, and via the Piazza forum. Do not send general questions by email to the TAs or to the instructor. This is so students with similar questions can have the best chance at benefiting from your question and the answer. If we answer the same question repeatedly to different students, it takes time away from new, different questions, and also poses a risk that we might give slightly different answers and create confusion. General questions sent by email will either receive no reply or else a canned reply reminding you of this policy.

If you have questions of a personal nature that apply only to you, or require confidentiality, feel free to send email to the instructor, come to office hours, or schedule an appointment to speak at another time.

Always include “ECE 36800” in the subject line, and send from your ▒▒▒ email address.


There will be approximately one programming assignment per week. To fetch the starter files (if any), you will run the command 264get hw05 (or likewise for the other assignments) from To submit, you will type 264submit hw05 hw05.c (or likewise).

Late work. Deadlines are at 11:59:59 PM according to the clock on unless otherwise announced. Due to the number of people taking the class, deadlines must be strictly enforced. Homework submitted up to 24 hours late will be subject to a penalty of 30% of the total possible points. 24-72 hours late will be subject to penalty of 50% of the total possible points. 72-120 hours late will be subject to a penalty of 70% of the total possible points.

Compiler warnings. Code that causes compiler warnings with compiled using gcc v8.3.0 (64-bit Linux) with the flags -g -std=c11 -Wall -Wshadow -Wvla -Werror -pedantic. on eceprog will be subject to a penalty of 40% of the total possible points.

Memory errors. Code that contains memory problems reportable by Valgrind will be subject to a penalty of 40% of the total possible points.

Code quality. Code that violates the code quality guidelines may be penalized 2% of the possible points per rule violated (any number of times).

Automated testers. For some assignments, we may enable automated testing prior to submission, to give you some early warning if it seems that your own testing was inadequate. These do not take the place of your own testing, and will generally not show the full detail about what test failed. Also, they may not include every test that will be used to score submissions. We may add more later, if we discover flaws in some student submissions that were not covered by the tester. Your job is to meet the assignment specification.

Multiple submissions. Your score will be based on the maximum of the following:
  • Score of latest submission as of the deadline.
  • Score of latest submission as of 24 hours after the deadline, minus 30% of the points possible.
  • Score of latest submission as of 72 hours after the deadline, minus 50% of the points possible.
  • Score of latest submission as of 120 hours after the deadline, minus 70% of the points possible.
Exceptions may occasionally be announced by the instructor prior to the deadline, such as for assignments that are to be human-graded.

You are encouraged to submit as often as you wish, even if your solution is incomplete. Submitting an incomplete solution increases the chance of receiving some points, in case you run into trouble later on. Also, every submission is backed up, so that we can help you in case of a disaster.

Partial credit. Where practical, partial credit will be given for submissions that meet the base requirements (below), and pass some but not all of our tests.

Base requirements. The following requirements apply to all assignments (where applicable), and are in addition to the requirements given in the assignment description.

  1. All required files must be included in a single submission.
  2. All required files must be named exactly as specified in the assignment description.
  3. Code can be compiled (as is) on eceprog with gcc v8.3.0 (64-bit Linux) and the following parameters: -g -std=c11 -Wall -Wshadow -Wvla -Werror -pedantic.
  4. Code can run on eceprog well enough to be tested.
  5. Code finishes in a reasonable amount of time (e.g., 2.0 seconds for most assignments)
  6. Function signatures and data types match the specification in the assignment description
  7. Any main(…) function must return EXIT_SUCCESS.
  8. Code follows our policy on academic integrity.

Any submission not meeting any of these eight base requirements will receive zero credit.

Homework bug bounty

For new or revised homework assignments, there may be unintended issues (e.g., ambiguities, inconsistencies, typos, etc.). Therefore, we are asking for your help in identifying issues with new assignments early.

The first person to find an report a significant issue—i.e., ambiguity, inconsistency, impossibility, or typos that substantially obscures the meaning—in a homework assignment will receive 1 participation point. Exceptionally insightful discoveries might receive 2 points.

You must post a message to the Piazza forum with the hbb tag and EXACTLY this subject (called “Summary” on Piazza):

HBB-HW##: description


HBB-HW01: Line numbers seem to be off

⚠ Your message must have the hbb tag and the subject must begin with HBB-HW## (replacing ## with the two-digit number of the relevant homework). For example, an HBB submission for HW01 should have a subject that begins with HBB-HW01.

Homework bug bounty points will be counted at the end of the semester by searching for that subject prefix (“HBB-HW##:”) and/or the hbb tag.

If you get the point, you will see “HBB ✔”.  If not, I will explain why and remove the "HBB-HW▒▒" from the subject line.

The instructor reserves the right to determine what constitutes “significant”, “first”, and ”exceptionally insightful”, and to limit the number of points per person per assignment. In other words, please don't spam the board with philosophizing about the meaning of words or silly stuff, but if you find something that might confuse your classmates, call it out.

C language standard We are using the C11 ISO/IEC 9899:2011 version of the C language, as compiled by gcc v8.3.0 (64-bit Linux) with the flags -g -std=c11 -Wall -Wshadow -Wvla -Werror -pedantic.
Regrades Follow the instructions on your Scores page.
Changes This syllabus is subject to change. In particular, homework contents and deadlines—may be changed without notice up to 1 week in advance. Homework weights may be adjusted at any time, to reflect the relative difficulty of the assignments. The grading scale cutoffs might be adjusted at any time, but any change between the beginning and end of the semester will be in students' favor. Other changes to course policies may be made to ensure the integrity of the course, to ensure fairness to students, or as otherwise deemed necessary by the instructor.
Academic integrity


The vast majority of students at Purdue do their work honestly and with integrity. The value of their grades and their ultimate degree is based on the expectation that earning a good grade always requires learning the material well, and demonstrating that in a way that can be measured (e.g., exams and assignments). Those who cheat are eroding that value, the reputation of Purdue, and ultimately the value of your diploma.

Cheating is unfair to those who do their work honestly, and even to the few who do not. It defeats the purpose of being a student at Purdue. It also defeats our dual purpose as instructors in this course: (1) to teach you data structures and algorithms, and (2) to ensure that a good grade in ECE 36800 is a dependable indicator of true proficiency in data structues and algorithms. If students are able to cheat, we have failed at both of those goals. For all of these reasons, we have a very strict stance against cheating.


For purposes of defining cheating for this course, the following definitions apply:

  • “Copying” means reproducing any kind of data (including code, text, etc.) by any means (including copy-paste, copying files, hand-typing, etc.) from one source to another.
  • “Trivial modifications” – include differences in whitespace, variable names, function order, constant values, or other changes that affect the appearance but not the function or intellectual content of the material.
  • “Attribution” means explicitly acknowledging the source of copied content with a comment in exactly this format: /* Credit: <author>, <description>, <url_or_location> */.
  • “Authorized sources” include:
    • code that you have written yourself
    • starter code for assignments retrieved using 264get
    • names of C standard library functions (e.g., printf(…)) and keywords (e.g., #include)
    • any other source explicitly allowed by your instructor (with attribution).
  • “Unauthorized sources” include any of the following (unless explicitly allowed):
    • code from Stackoverflow, GitHub, Wikipedia, or any other web site
    • code generated by ChatGPT, Github Copilot, or other generative AI tools
    • code from the textbook or any other book
    • test cases given in assignment descriptions
    • snippets provided by the instrucor (unless marked “OK to copy/adapt”)
    • any other source that is not an authorized source
  • “Unauthorized aid” means any resource that provides information or functionality relevant to a quiz or exam that was not explicitly allowed by your instructor. Unauthorized aids include:
    • hidden note sheets (on a closed-book exam or quiz)
    • other students' papers
    • calculator
    • watch
    • any other resource not explicitly allowed
  • “Cheating” includes doing—or attempting to do—any of the following:
    • Copying any amount of code from another students' code, the web, a book, or any other unauthorized source, even with trivial modifications. You may use code from the course reference sheet or code that you wrote yourself.
    • Allowing another student to copy your code
    • Using unauthorized means to alter or affect grades, submission timestamps, or submission contents, or anything else that might affect grades.

Copying code and then modifying it to make it appear different is still copying. Modifying the copied code (e.g., changing constant values, variable names, whitespace, etc.) is merely an attempt to hide the evidence of your copying—adding deception on top of plagiarism.

You must write your code from scratch using your brain and the letter and symbol keys on your keyboard. There should be no Ctrl-V (or Cmd-V or right-click anything) or email attachments at any point in the process.

Be careful not to reveal your code to others inadvertently. It is your responsibility to log out when you leave, and guard any printed copies of your work. If we discover two assignment submissions that are identical or very similar, both may be penalized.

Do not share your code on Github or anywhere else, during—or even after—the semester.

Do not copy code written by the instructor—even snippets from lecture or example test cases—unless it is part of the starter code or explicitly labelled as “OK to copy/adapt” (or similar). This provides freedom to discuss closely related problems in lecture or in the online discussion without spoiling the assignment. It also reinforces the principle that “your code” really does mean “your code” (i.e., written by you).

Never send your code by email.

Gray areas

Discussing abstract ideas and high-level strategies about homework assignments using converation and diagrams (e.g., standing at a whiteboard) is allowed and encouraged.

You may help a friend find a bug in their code, if you can do so with them in person on their screen and without editing their code, suggesting specific edits, or causing/enabling any semblance of “copying” (looking and typing, sending code by email, etc.). The best way to stay safe is to help them debug only after you have finished 100%, but that is up to you.

Use your discretion to avoid defeating anyone's educational opportunity (i.e., spoiling their challenge). This should not involve code.

Learning from code on the web or other sources is allowed, as long as you do not copy it by any means (including looking and typing it). Again, learning abstract ideas is allowed, though you should use good judgment to ensure that you learn how to solve programming problems.

Very generic code snippets (e.g., #include <stdio.h>) and the names of library functions should not require any copying. You should know those from memory.


Very minor instances (e.g., 1-3 lines of code from the web on a homework) will result in a score of zero for the affected assignment. All other instances will result in an "F" in the course, and a referral to the Office of Student Rights and Responsibilities.

Penalties are not the goal, but they are a necessary component of an incentive system to shape behavior. To reduce the need for penalties, we spend time talking about academic integrity in lecture and there are often reminders scattered in assignment descriptions.

The giver and the receiver are equally responsible. The offense is not one's inability to complete the assignment, but rather the erosion of ethical standards.

Penalties will be applied even on the first offense, regardless of how you were doing up to that point. If someone asks you to share your code, your response should be, “No.”

We actively search for evidence of plagiarism and other types of academic dishonesty using a variety of methods.

Penalties may be applied whenever we find evidence of academic dishonesty—even long after scores were posted.

If are unable to finish a homework, cheating will only make things worse. If you copy code—even just half of one assignment—you will fail this class.

There are no penalties for discussing ideas in words or drawing pictures together in a way that does not entail copying. (Use your discretion.)

How to report cheating

Please report any cheating you see or hear about, or requests to share your code. You may notify the instructor in person, by email, or anonymously (e.g., non-Purdue email address that does not identify you, note under door, etc.). In doing so, you will be improving the fairness for the entire class, while also teaching the individual(s) a valuable lesson.

Even if you do not wish to name an individual, we welcome any feedback you may have about how we can ensure fairness and integrity in this course.

Penalties are not the goal. This is about teaching ethical conduct and preserving the intellectual integrity of our academic environment here at Purdue, while preparing you for a career producing intellectual property for hire in a legal environment where any infringement can bring lawsuits and penalties for companies. Also, ethics is a mandatory part of the engineering curriculum, as required by ABET (Accreditation Board for Engineering and Technology).

To minimize the need for penalties, we spend time in lecture and scatter reminders in assignments. However, enforcement is a necessary component of this effort.


You may retract your submission of any homework without penalty by sending email to the instructor with subject line “retract HW▒▒ [264]” any time before the submission deadline.

Generative AI

"GenAI" refers to generative AI tools, such as ChatGPT.

Do NOT copy any code or text from GenAI into assignments.

Do use GenAI to get alternative explanations to concepts or explore ideas

Do explore the opportunities that GenAI creates for you as a programmer in the future.

We will not rely on any AI detectors to determine if GenAI tools generated any of your code. If we strongly believe but cannot prove that code from GenAI was copied into your submission, we reserve the right to simply factor out an assignment from your grade. That would happen only after discussing with you, and considering all available evidence.

Late registration

Students who register late must do all of the same assignments. If you register after any assignment is due, or less than 2 days before the deadline, you may request an extension by providing proof of the late registration to the instructor. The extension is not automatic.

Grief Absence Purdue University recognizes that a time of bereavement is very difficult for a student. The University therefore provides the following rights to students facing the loss of a family member through the Grief Absence Policy for Students (GAPS). GAPS Policy: Students will be excused for funeral leave and given the opportunity to earn equivalent credit and to demonstrate evidence of meeting the learning outcomes for misses assignments or assessments in the event of the death of a member of the student’s family.
Violent behavior Purdue University is committed to providing a safe and secure campus environment for members of the university community. Purdue strives to create an educational environment for students and a work environment for employees that promote educational and career goals. Violent Behavior impedes such goals. Therefore, Violent Behavior is prohibited in or on any University Facility or while participating in any university activity.

Purdue University is required to respond to the needs of the students with disabilities as outlined in both the Rehabilitation Act of 1973 and the Americans with Disabilities Act of 1990 through the provision of auxiliary aids and services that allow a student with a disability to fully access and participate in the programs, services, and activities at Purdue University.

If you have a disability that requires special academic accommodation, please make an appointment to speak with me during the first week of the semester in order to discuss any adjustments. It is important that we talk about this at the beginning of the semester. It is the student's responsibility to notify the Disability Resource Center of an impairment/condition that may require accommodations and/or classroom modifications.

Emergencies In the event of a major campus emergency, course requirements, deadlines and grading percentages are subject to changes that may be necessitated by a revised semester calendar or other circumstances beyond the instructor’s control. Relevant changes to this course will be posted onto the course website and/or sent by email to the Purdue email address ( of students registered in this course. You are expected to read your Purdue email on a frequent basis.

Purdue University is committed to maintaining a community which recognizes and values the inherent worth and dignity of every person; fosters tolerance, sensitivity, understanding, and mutual respect among its members; and encourages each individual to strive to reach his or her own potential. In pursuit of its goal of academic excellence, the University seeks to develop and nurture diversity. The University believes that diversity among its many members strengthens the institution, stimulates creativity, promotes the exchange of ideas, and enriches campus life.

Purdue University prohibits discrimination against any member of the University community on the basis of race, religion, color, sex, age, national origin or ancestry, genetic information, marital status, parental status, sexual orientation, gender identity and expression, disability, or status as a veteran. The University will conduct its programs, services and activities consistent with applicable federal, state and local laws, regulations and orders and in conformance with the procedures and limitations as set forth in Executive Memorandum No. D-1, which provides specific contractual rights and remedies. Any student who believes they have been discriminated against may visit to submit a complaint to the Office of Institutional Equity. Information may be reported anonymously.


Among the materials that may be protected by copyright law are the lectures, reference sheet, this web site, assignments, and other material presented in class or as part of the course. Always assume the materials presented by an instructor are protected by copyright unless the instructor has stated otherwise. Students enrolled in, and authorized visitors to, Purdue University courses are permitted to take notes, which they may use for individual/group study or for other non-commercial purposes reasonably arising from enrollment in the course during the semester in which the student was enrolled.

Notes taken in class are, however, generally considered to be “derivative works” of the instructor’s presentations and materials, and they are thus subject to the instructor’s copyright in such presentations and materials. No individual is permitted to sell or otherwise barter notes, either to other students or to any commercial concern, for a course without the express written permission of the course instructor. To obtain permission to sell or barter notes, the individual wishing to sell or barter the notes must be registered in the course or must be an approved visitor to the class. Course instructors may choose to grant or not grant such permission at their own discretion, and may require a review of the notes prior to their being sold or bartered. If they do grant such permission, they may revoke it at any time, if they so choose.

// Credit: A substantial portion of this policy document is derived from a template authored by the Purdue Center for Instructional Excellence.