Don't like this style? Click here to change it! blue.css

Homework 1: C++ from zero to linked lists

Pick 4 out of these 5 to solve.

Problem 1: 8-bit Hero Pickling

Design an 8-bit RPG hero pickler. That is devise an encoding and decoding of a "hero" into an 8-bit integer (a char).

Provide a function for asking someone to create their hero and at the end tell them their 8-bit sequence.

Provide a function which takes in an 8-bit sequence and displays the pertinent information about that hero.

Give me an 8-bit hero which you think Grace Hopper might have picked.

Problem 2: Integer Factoring

Write a function which takes in an unsigned int and displays a prime factorization of that integer.

Problem 3: Person Struct

Design a "person" struct which contains data and or methods that a "person" might need.

Write an in-place body swapper. This function should allow you to have two people switch some attributes in-place.

Problem 4: Home-cooked vector

Make your own dynamic array template. It should allow creating contiguous arrays (filled with things of the same type) which you can extend without worrying about running out of space.

Do one version using malloc and free.

Do one version using new and delete.

Problem 5: Write a linked list

Create a node (either class or struct) which has some key data and has pointers to the next node and the previous node.

Create a linked list class which allows adding nodes, removing nodes, and searching for a node based on value.