Presentation is loading. Please wait.

Presentation is loading. Please wait.

EE 312 Final Exam Review.

Similar presentations


Presentation on theme: "EE 312 Final Exam Review."— Presentation transcript:

1 EE 312 Final Exam Review

2 Exam Format 165 Total Points All point values are approximations
50 Points Writing Programs 45 Points Short Answer 35 Points of Tracing Code 35 Multiple Choice All point values are approximations

3 Example Programming Problems
Compare two linked lists to see if they are equal. Write a recursive function to find the largest value in a BST. Write the code to overload the == operator for the UtPod (You would be given the signature.)

4 Example Short Answer Explain why traversing a linked list of nodes is an O(n) operation. Is the following (code would be given) a reasonable way to implement a Stack? Explain a reasonable way to choose the pivot for a quicksort if you do not know the relative order of the elements in the data? Draw a BST after the following elements have been added: (12, 34, 22, -3, 42, 17) What is the Big O time for inserting an item into a complete binary search tree?

5 What will the EXACT output of the following program be?
int foo = 9; int *ptr = &foo; float foo2 = 5.7; *ptr = 2; foo2 = foo - foo2; if (foo > foo2) printf("Hello!\n“); else if (foo < foo2) printf(“%f\n”, foo2); else printf(“%d\n”, foo); printf(“\n”); printf (“foo2 is %f\n”, foo2);

6 Fundamentals of C ?? Points Declaration of variables and functions
Looping and conditional statements While, for, if One and two dimensional arrays Simple I/O Printf, scanf, fscanf, fgets

7 Pointers Relationship between arrays and pointers 5 Points
A pointer is a variable that holds the address of a memory location Declaration int *ptr; Assignment ptr = &foo; //& is the address function Dereferencing *ptr = 54; //same as foo=54; You can point to any kind of data type Relationship between arrays and pointers Understand the “malloc” and “free” commands

8 Structures 10 Points Declaration Assignment Use of the “.” operator
Pointers to structures (*ptr).field ptr->field Structures used in Linked Lists

9 Linked Lists 30 Points Declaring a linked list
Adding a node to a linked list Removing a node from a linked list Traversing a linked list What is the order of magnitude of each of the above operations? Understand the Stack312_ll code and the linked list code from class.

10 Stacks and Queues 6 Points Operations FIFO vs LIFO
makeStack Push Pop isEmpty isFull FIFO vs LIFO Know how to use in a problem and implement Understand the Stack Fun! assignment

11 Linux 6 Points Know the basic commands you needed to complete a program in Linux Know how to edit a file in Linux Know how to compile and run a C program in Linux Know how to create directories and move around the Linux file system

12 Command Line arguments
0 Points Make sure you understand how to use argc and argv Understand the use of atoi(char *)

13 Algorithm Analysis 25 Points Understand what Big O notation is
Be able to look at an algorithm or piece of code and determine how much work it has to do (and then the Big(O) analysis of the code) Understand the relative speed of the Big O orders. Which is faster? O(1) or O(n)

14 Object Oriented Programming
45 Points Class structure Instance and Class variables Instance and Class functions Understand Constructors and Destructors Default and overridden How and when they are called Calling instance functions How to override relational operators and why they are necessary for container classes.

15 OOP, STL,Templates (cont.)
Templated Classes and Functions You will not have to write any template code. How to use vectors. Understand the UtPod and Go Fish programs.

16 Trees 25 Points Definitions General Trees vs. Binary Trees
Terminology: path, depth, height, etc. General Trees vs. Binary Trees Tree Traversals Preorder Inorder Postorder Binary Search Trees

17 Trees (cont.) Binary Search Tree Be able to code anything from BST_312
Insert Delete Find Count Nodes Be able to code anything from BST_312 Make sure you understand the recursive and iterative solutions for each function.

18 Recursion 10 Points Understand
Base case Smaller caller General case Will have to write a recursive functions Be able to do time analysis of a recursive function Understand math stuff, recursive flood fill and the BST programs.

19 Searching and Sorting 20 Points Algorithms
Will not have to code the sorts or searches Know the algorithms REALLY WELL! Will likely have to draw, trace, or produce psuedo-code Time and space considerations Linear Search Binary Search O(n2) sorts Selection sort, Insertion sort O(nlog2n) sorts Mergesort, Quicksort

20 Hashing 15 Points Hash tables Hash Functions Collisions
Using strings as keys Collisions Separate chaining Open Addressing Linear probing Quadratic probing Double Hashing Be able to hash a list of keys given a function and collision strategy

21 Priority Queues 5 Points Can be implemented as a heap
Know the algorithms enQueue deQueue Be able to figure out Big O analysis of operations

22 Heaps 6 Points Definitions Array-based implementation of binary trees
Full binary tree Complete binary tree Array-based implementation of binary trees Parent-child relationships Calculations to find nodes Heap property ReheapDown, ReheapUp

23 HeapSort 0 Points Basic Algorithm Big O analysis
Transform array items into heap Get smallest item and reheap until heap is empty Big O analysis

24 How to Study Rewrite all the programs.
Concentrate on the last four. Look at all the data structures and algorithms and see how much work each operation involves with the different implementations of the algorithms for figuring out the Big O questions. Don’t memorize C or C++! Code syntax will be on the exam. Learn by doing and recognizing patterns. Don’t stay up late!! Get some sleep and eat a good breakfast.

25 What to bring Pencils and erasers We will provide scratch paper
No calculators

26 Questions


Download ppt "EE 312 Final Exam Review."

Similar presentations


Ads by Google