Gearing Up for Spring 22 Data Structures

Happy New Year!  I hope your winter break has been restful and relaxing!

I’ve gotten a few requests from folks about how to prepare for CS 2341.  So I thought I’d provide a list of things to review before class starts:

  • C++ Language
    • Pass by value vs pass by reference vs pass by pointer
    • Pointers and dynamic memory allocation
    • How to declare classes and their main methods (constructors, destructors, etc)
    • Operator overloading in a class
    • Object composition 
    • Did I mention Pointers?  
      • How to declare a pointer?
      • How to dynamically allocate memory on the heap?
      • How to dynamically allocate an array of pointers? 
      • the & operator and the * operator
    • How to separate interface from implementation 
    • reading and writing files and parsing data 
  • Conceptual Things
    • How to break a problem down into bite-sized chunks. 
    • The idea that a function should do one thing and it should only do that one thing
    • Developing algorithmic solution to basic problems involving a simple 1D array
      • make use of control structures like ifs and loops
      • example: Find the 2nd smallest value in an array with only 1 loop. 
    • The conceptual relationship between pointers and arrays.
    • How to use a debugger

Perhaps the thing that is the biggest curve ball to students in 2341 is the scope and scale of the programming projects.  They will be much larger than you’ve encountered in previous classes.  This is intentional.  Learning to take a really large project description and break it down into manageable pieces (said another way: how to functionally decompose a problem) is as important of a skill to develop as actually being able to write the code to solve one of those pieces. 

 

Spring 2019 Help Desk Schedule

The Spring 2019 Help Desk Schedule…

Java – Exam Stats Example

This post is another in the series of small Java Programs and their evolution.  The scenario for the program today, Exam Statistics, is calculating a couple statistics for a set of grades entered by the user. You can see in the code below, I work on one method, test it, then move on to the next method.

[Read more…]

Time for some Java

Let’s take a simple program idea and refine it over the course of a few versions of the code. 

The program we are writing is meant to print a box made of asterisks.  The width and height of the box is based on a value entered by the user.  For example, if the user enters 3, the program would display the following: [Read more…]

Gearing Up for a taste of Data Science

Here are some things to do to gear up for getting a taste of Data Science in CSE 3330.

  1. Download and install R. You can download it from this link
  2. Download and install RStudio from this link. Scroll down to the bottom of the page to find the installers for various platforms.  Note that you will run this on your laptop directly, not through vagrant or anything like that.

Good Resources:

  • The RStudio folks also produce some very useful cheat sheets for using R and RStudio.  You can find a list of them here.
  • Data Camp’s Introduction to R (a Free Course)

More to come…

 

SMU in Weimar 2017 Info

Some important/useful information for our amazing study-abroad trip this summer:

Travel Info

Class Docs

Binary Trees and Binary Search Trees

Trees are a very important data structure, especially binary trees and its variants.  Please watch the videos linked below to get up to speed on Trees, Binary Trees, Binary Search Trees.

 

More on Linked Lists in C++

Linked lists can be tricky some times.  Here are some additional resources as you’re working through understanding them.

Youtube Videos:

Binary Trees

Binary trees are a very fundamental data structure in computer science.  As you continue to learn and explore in different sub-domains of CS, you’ll see them pop up quite frequently.  Here are some things you should Binary Trees and their cousins.

  • General Binary Trees
    • Pre -, In -, and Post-order traversals
    • The height (or depth) of a tree
    • Different node terminology (leaf, level, ancestor, descendant, etc.)
    • Some info to peruse
  • Binary Search Trees
    • Remember, binary search trees are binary trees that also conform to the binary search property: all values in the left subtree of a node are smaller and all values in the right subtree of a node are larger (duplicates not withstanding)
    • Some algorithms you should think about w.r.t. bin search trees:
      • inserting a new value
      • searching for a value
      • deleting a value from the tree
      • determining the height of the tree
      • determining if a binary tree is indeed a binary search tree
      • what’s the most efficient way to create a copy of a binary search tree?
      • what’s the best way to destroy (delete all nodes) a binary search tree?
    • Some info to peruse
      • David Eck link above
      • Cliff Shaffer’s Data Structures and Algorithms book linked above Section 5.4 starting on page 168.
  • AVL Tree – a Self Balancing Binary Search Tree
    • AVL Balance Property: for every node n in an AVL tree, the height of the left subtree and the height of the right subtree may differ by no more than 1.
    • Some info to peruse

Lists, Stacks, and Queues

Lists, stacks, and queues are some of the most fundamental data structures to computer science.  Below are some links to information you may find helpful as you explore these data structures:

There are plenty of videos on Youtube about these topics as well. Check them out.