ECE218 T Data Structures Autumn 2023
Tue, Thur, 5:05 to 6:20 in Communications International 3055

Useful information and things

Examinations:

Assignments:

Read the Important Rules link above.
All to be submitted on blackboard (under Assignments).
Submissions should be clearly readable word documents.
Capture your code with "cat", copy, and paste.

    1   Due: Thursday 7th September.
       A reverse-polish calculator with variables and functions.
2Due: Saturday 30th September.
Supercalculator - int calculations with unlimited precision.
3Due: Saturday 21st October.
More functionality to your supercalculator.
4Due: Thursday 9th November.
Sort a database of a million people.
5Due: 5:05 p.m., Thursday 16th November.
Work out how to implement doubly-linked lists.
6Due: Wednesday 13th December BEWARE: no extensions will be possible.
Binary tree database.

PC log in - use Putty or your own preferred SSH app.
OR mac users: start the terminal app, windows users: start powershell, then type the command
ssh username@rabbit.eng.miami.edu and type your password when prompted.
Windows users beware: you can't use ctrl-V in pico, but page up and page down will do the job.

Class History

Class 1 - Tue 22-8-2023    Introductory Bits.
Everyone already has an account on the server. username = UM email before @.
Can't cover everything, C++ is a very big language.
A word about pointers.
How dangerous arrays are, 10, 100, 200, 1000.
Take-aways from today's class.
Class 2 - Thur 24-8-2023 Making arrays safe.
Introducing vectors from the standard library.
So why does anybody use arrays at all any more?
Take-aways from today's class.
Class 3 - Tue 29-8-2023 With a vector you should habitually use at rather than [].
Abstract Data Types and Concrete ones. The stack as an example of an ADT.
Old fashioned C strings, and the useful strtod function.
Reverse Polish Notation: a use for a Stack.
Beginning the implementation of a vector: create and enlarge.
Take-aways from today's class.
Class 4 - Thur 31-8-2023 Completing the vector of doubles, defining operators + * [] and so on.
Reference results - just like reference parameters.
Separate compilation, .cpp, .o, and executable files, compiling and linking.
Templates for functions and classes. Templates go in .cpp files.
Take-aways from today's class.
Class 5 - Tue 5-9-2023 Mention HKN.
Examples of many class/struct related things.
Default constructor, copy constructor, proper assignment, lazy replacement.
Class methods, class constants, const methods, output not method, int for post.
Why have copy constructors?
Take-aways from today's class.
Class 6 - Thur 7-9-2023 got up to <<. class variable, methods are outside class def.
Fast graphics operations, Bad C++ two-dimensional arrays.
This would be better but for the fact that it doesn't work.
How to make a safe multi-dimensional array/matrix.
A bitmap or bitarray. Got to set knowing intnumber and bitnumber. 32 or 64?
Take-aways from today's class.
Class 7 - Tue 12-9-2023 All the bit-wise operators with examples.
Finishing the bitmap.
Exceptions: one, two, three.
Assign result before destroy at end of function.
Take-aways from today's class.
Class 8 - Thur 14-9-2023 Supercalculator. 32 or 8? maxnegint is -2147483648.
An attempted database.
Take-aways from today's class.
Class 9 - Tue 19-9-2023 Making the database work properly by using pointers.
A reference implementation of a superint type.
Today's clicker questions.
Stack and heap allocation, demostration.
At the supermarket.
Take-aways from today's class.
Class 10 - Thur 21-9-2023 Practical linked list operations, we were half way through reverse at the end.
Take-aways from today's class.
Class 11 - Tue 26-9-2023 Updated HKN tutoring times.
Supercalculator implementation tips.
Today's clicker questions.
Make use of a linked list's natural tendency to be backwards to reverse on efficiently.
Finding the length (just record it if that's a frequent operation).
Adding to the end, the inefficient way.
Take-aways from today's class.
Class 12 - Thur 28-9-2023 Just reminders: The essential Unix commands and pico/nano editor controls.
The efficient way to add an item to the end of a linked list.
Removing items in all sorts of ways.
Accumulating a compound value.
Take-aways from today's class.
Class 13 - Tue 3-10-2023 accumulating, with a template too,
Today's clicky questions.
Destructor or destroy all?
Selection Sort on a linked list. We discover that it is quadratic.
Complexity, what O(...) means, and a way of determining it.
Take-aways from today's class.
Class 14 - Thur 5-10-2023 Today's clicky questions.
Selection sort on an array, Bubble sort both ways, Insertion sort both ways.
Take-aways from today's class.
Class 15 - Tue 10-10-2023 A short word about stod's "worthlessness".
The third assignment.
Today's clicky questions. You must verify.
About insertion sort on an array, how to avoid the need for a second array.
Take-aways from today's class.
Class 16 - Thur 12-10-2023 Test review for as long as it takes.
We discovered Merge-sort in an educational exercise at the end.
Class 17 - Thur 19-10-2023 First test. Topics:
1. Vectors. How to use them, how they work, how to implement them,
2. Multi-dimensional arrays or matrices. how they work, how to implement them,
3. All about linked lists,
4. The array/vector/linked list sorting algorithms.
A sample test (not question 1), and its solution,
Another sample (only question 3), and its solution.
Another sample (only question 6),
Yet another sample (not question 6), and its solution.
Class 18 - Tue 24-10-2023 An ordinary linked list of strings add an enumerator.
Merge-sort on a linked list.
Counting the number of operations reveals that its time is better than quadratic, but what?
Analysis shows numper of ops = 5×N×log2N compared to the familiar ½×N2.
Take-aways from today's class.
Class 19 - Thur 26-10-2023 How much faster is 5×N×log2N than ½×N2? and the answer.
Merge-sort on an array, the loops are a bit complicated.
Introducing Quick-sort, only for arrays this time.
Take-aways from today's class.
Class 20 - Tue 31-10-2023 Next assignment and cmath things.
Questions about the mid-term if necessary.
Today's clicky question. You must verify.
The loop's invariant and variant: confirmation that it is right.
Take-aways from today's class.
Class 21 - Thur 2-11-2023 Our second partition method animated,
The entire quicksort algorithm animated.
Quicksort's first appearance, the algorithm part 1, part 2. The test system.
A little bit of number theory.
Inheritance, Polymorphism, Virtual Methods in 8 steps: one, two, three, we only got to the third.
Take-aways from today's class.
Class 22 - Tue 7-11-2023 The remainder of Inheritance, Polymorphism, and Virtual Methods: four, five, six, seven, eight.
Today's clicky question. You must verify in class.
What Binary Trees are all about.
Take-aways from today's class.
Class 23 - Thur 9-11-2023 More binary trees. Some non-recursive methods, print all, and a new fast sorting algorithm.
Class 24 - Tue 14-11-2023 Preparation for Thursday's test as needed.
Class 25 - Thur 16-11-2023 Second mid-term. The topics are:
Merge-sort (on linked list and array),
Quick-sort,
Big O() when logarithms or exponentials are involved,
Object orientedness, inheritance, polymorphism, virtual methods,
Doubly-linked lists.
For samples see the last three samples for the first test.
Class 26 - Tue 28-11-2023 Depth first search (DFS) or breadth first search (BFS)?
Four traversals, in-order DFS, pre-order DFS, post-order DFS, and BFS.
The correct way to save a tree in a file.
How a queue makes BFS work; BFS finds the easiest to reach solution.
A tree to represent normal exressions, evaluating it, building from forward polish.
Class 27 - Thur 30-11-2023 Using the debugger.
Virtual in the right order.
A number of things about encryption.
Class 28 - Tue 5-12-2023 Another binary tree question, the 7th real question on the final.
Question 7 on the third sample for the first mid-term is also on this topic.
Deleting a data item from a binary tree.
Hints of future things to fill the last few minutes:
2-3-trees for guaranteed balance, hash functions for digital fingerprints and fast data access.
I had remembered the topic that I had in mind, what we actually did is much more useful.
Last week I said I'd post the superint-related cryptography code. Here it is.