Data Structures: Assignments

Topics Assignments Slides Algorithms References

See Course page by Jānis Lazovskis with worksheets. Many more worksheets are in ORTUS.

In-Class Assignments (max 200‰)

These are short paper-based algorithmic tasks done in class; about 10-15 minutes long; people who write them from home get 3 extra minutes of work to download the paper, to photograph and to send their solution. We had 15 such exercises. (Sample assignments are just a preview for the real thing, they do not affect grade).

Grading IDTitle Due Date Time Est. Max Average
MK01 Bitwise operations, flowcharts
Sample
2020-09-14 12 min. 10‰ TBD
MK02 Arrays, Pointers
Sample
2020-09-18 12 min. 10‰ TBD
MK03 Using STL
Sample
2020-10-01 12 min. 10‰ 8.28‰
MK04 Pointer Operations
Sample
2020-10-07 12 min. 10‰ TBD
MK05 Big-O-Notation
Sample
2020-10-14 12 min. 10‰ 4.61‰
MK06 Heaps
Sample
2020-10-28 12 min. 10‰ TBD
MK07 Hashtables
Sample
2020-11-05 12 min. 10‰ TBD
MK08 Binary Trees
Sample
2020-11-11 12 min. 10‰ 8.39‰
MK09 Quicksort
Sample
2020-11-12 12 min. 10‰ 8.78‰
MK10 Red-Black Trees 2020-11-30 12 min. 10‰ TBD
MK11 Topological Sort 2020-12-10 30 min. 20‰ TBD
MK12 Strongly Connected Components 2020-12-10 30 min. 20‰ TBD
MK13 Dijkstra's Algorithm 2020-12-10 30 min. 20‰ TBD
MK14 Bellman-Ford Algorithm 2020-12-10 30 min. 20‰ TBD
MK15 MST Prim's Algorithm 2020-12-10 30 min. 20‰ TBD

2 Exams (max 300‰)

Due to the epidemic both exams were remote; notes and external references could be used.

Grading IDTitle Due Date Time Est. Max Average
MIDTERM Midterm
Midterm Solution
Sample (Stacks and Queues)
2020-10-22 100 min. 150‰ 110.28‰
FINAL Final
Sample Final
2020-12-17 120 min. 150‰ TBD

Walk-Throughs

These activities are not graded. Most tools introduced here are not mandatory. We appreciate, if you inform others about your preferred C++ coding practices.

Coding Exercises (max 500‰)

These exercises are meant to write simple C++ programs. We plan 7 or 8 such exercises.

Ortus grade ID Title Additional Info Due Date Time Est. Max Average
EX1 Periodic strings Palindromes (Sample code) 2020-09-09 4h 20‰ 12.75‰
EX2 Finding extreme students N/A 2020-09-11 4h 20‰ 16.94‰
EX3 Reverse an ordered tree Inverted Trees in advertising;
What is a stub;
Encapsulation in programming.
2020-09-25 12h 20‰ 8.88‰
EX4 Matrix Operations Operators/Templates (Sample code) 2020-10-05 4h 30‰ 21.19‰
EX5 Circularly Linked Lists Makefile (also for unit tests);
Catch2TestRunner.cpp.
2020-10-12 4h 30‰ 24.38‰
EX6 Shapes and Transformations Testcases (ZIP) 2020-10-26 12h 30‰ 15.00‰
EX7 Aliens Testcases (ZIP) 2020-11-09 12h 100‰ 71.50‰
EX8 Balancing Binary Trees Testcases (ZIP) 2020-11-30 12h 100‰ 59.38‰
EX9 Code Reviews (style, leaks, performance)   2020-12-04 12h 150‰ 123.33‰

Grading Weights (20+20+20+30+30+30+100+100+150=500)

Download all testcases

Unzip the directory "workspace-kalvis" so that it located in the same subdirectory as your own workspace. Copy the ex03-alice/grading-default.sh or a similar grading file into your EX03 directory; make the script executable ("chmod u+x grading-default.sh") and run it. If your code needs other compiler options in order to run (and some tests failed because of this grading approach), please let me know by January 4, 2021. Every exercise has a different default grading script. (EX06 does not check your output file with the expected SVG file with diff; instead you can just visually compare the images - your SVG should show the same thing as the expected result.)

  • Build (nonfunctional):
  • T01 in/out (public): Simple test on strings
  • T11 in/out (private): Extremely short strings
  • T12 in/out (private): Short (1-2 character) periods
  • T13 in/out (private): Periodic inputs: Up to 100 chars
  • T14 in/out (private): Periodic inputs: Up to 1000 chars
  • T15 in/out (private): Non-Periodic inputs: Up to 1000 chars
ID Build T01 T11 T12 T13 T14 T15 Total Notes
011 2333003 14
081 0000000 0 CPP, H files missing
167 2333333 20
370 2333333 20
371 2333003 14
372 2303333 17
373 0000000 0 Compilation error
374 2333333 20
376 2333003 14
377 2333333 20
378 2333333 20
380 2333333 20
381 0000000 0 CPP, H files missing
382 0000000 0 CPP, H files missing
384 2330003 11
385 0000000 0 Version control issue
386 2333003 14
387 0000000 0 Version control issue
  • Build (nonfunctional):
  • T01 in/out (public): Three students, some rounding
  • T02 in/out (public): Just one student
  • T03 in/out (public): Many identical ages
  • T04 in/out (private): 100 students; 15-digit doubles
  • T05 in/out (private): 10000 students normally distributed.
  • T06 in/out (private): Five students, integer-only input
ID Build T01 T02 T03 T04 T05 T06 Total Notes
011 2333333 20
081 2333333 20
167 2333333 20
370 2333333 20
371 2333333 20
372 2333333 20
373 2303003 11 “Invalid age” messages
374 2333333 20
376 2333333 20
377 2333333 20
378 2333333 20 CPP, H files missing
380 2333333 20
381 0000000 0 CPP, H files missing
382 2333333 20
384 0000000 0 Compilation error
385 0000000 0 CPP, H files missing
386 2333333 20
387 0000000 0 Version control issue
  • T01 in/out (public):
  • T02 in/out (public): 4 internal nodes NOT in preorder sequence
  • T03 in/out (public): Smallest example - 1 internal node, 1 child
  • T04 in/out (public): Bushy tree: 10000 nodes, 2 levels
  • T05 in/out (public): Skinny binary tree: 9999 nodes, 4999 levels
  • T06 in/out (public): Medium example; root is the smallest; mixed order
  • T07 in/out (public): Medium example; root is not the smallest; mixed order
ID T01 T02 T03 T04 T05 T06 T07 T08 T09 T10 Total Notes
  • T01 in/out (public):
  • T02 in/out (public): Adding 2 small matrices (Q)
  • T03 in/out (public): Impossible multiplying 2 small matrices (R)
  • T04 in/out (public): Impossible subtraction of 2 medium matrices (Z)
  • T05 in/out (public): Impossible addition of 2 medium matrices (Q)
  • T06 in/out (public): Row-vector 1*n multiplies with square n*n matrix (Z)
  • T07 in/out (public): Matrices 2x2 add together to test rounding (R)
ID T01 T02 T03 T04 T05 T06 T07 T08 T09 T10 Total Notes
  • T01 in/out (public):
  • T02 in/out (public): Testcase 2
  • T03 in/out (public): Testcase 3
  • T04 in/out (public): Testcase 4
  • T05 in/out (public): Testcase 5
  • T06 in/out (public): Testcase 6
ID T01 T02 T03 T04 T05 T06 Total Notes
  • T01 in/out (public):
  • T02 in/out (public): Draw a circle
  • T03 in/out (public): Translate and draw a square
  • T04 in/out (public): Do two transformations on a square
  • T05 in/out (public): Do “GROUP 1” to test faulty memory management
  • T06 in/out (public): Do “GROUP 2” to test faulty memory management
  • T07 in/out (public): Do SHEAR transformation, draw trapezoids
  • T08 in/out (public): Draw a group of circles
  • T09 in/out (public): Draw a group of circles on a checkerboard pattern
  • T10 in/out (public): Flag of South Korea (semicircles etc.)
  • T11 in/out (public): Draw the flag of Japan (just 2 shapes – one circle)
  • T12 in/out (public): Draw the flag of Czech Republic (3 shapes, all polygons)
  • T13 in/out (public): Draw overlapping shapes to test the stacking order
  • T14 in/out (public): Draw the flag of Cuba
  • T15 in/out (public): Draw the flag of US
ID T01 T02 T03 T04 T05 T06 T07 T08 T09 T10 T11 T12 T13 T14 T15 Total Notes
  • T01 in/out (public):
  • T02 in/out (public): Testcase 2
  • T03 in/out (public): Testcase 3
  • T04 in/out (public): Testcase 4
  • T05 in/out (public): Testcase 5
  • T06 in/out (public): Testcase 6
  • T07 in/out (public): Testcase 7
  • T08 in/out (public): Testcase 8
  • T09 in/out (public): Testcase 9
  • T10 in/out (public): Testcase 10
  • T13 in/out (public): Testcase 13
  • T14 in/out (public): Testcase 14
  • T15 in/out (public): Testcase 15
ID T01 T02 T03 T04 T05 T06 T07 T08 T09 T10 T13 T14 T15 Total Notes
  • T01 in/out (public):
  • T02 in/out (public): Only inserts; lex order
  • T03 in/out (public): Only inserts; colex order
  • T04 in/out (public): Insert and erase in mixed order; no rotations (shortlex order)
  • T05 in/out (public): Insert medium size natural text
  • T06 in/out (public): Insert very long natural text; increment badness correctly
  • T07 in/out (public): Create one AVL, then remove it, then insert another
  • T08 in/out (public): Check an almost alphabetical insert; a list of 3000 words
  • T09 in/out (public): Some AVL example from a textbook
  • T10 in/out (public): Small AVL tree with a 2-step rotation upon erase
ID T01 T02 T03 T04 T05 T06 T07 T08 T09 T10 Total Notes