1 / 26

EE 312 Final Exam Review

This review guide provides an overview of the final exam format for .EE.312, covering topics such as writing programs, tracing code, short answer questions, and multiple choice. It also includes example programming problems and covers fundamentals of C, pointers, structures, linked lists, stacks and queues, Linux commands, command line arguments, algorithm analysis, object-oriented programming, templates, trees, recursion, searching and sorting, and hashing.

mthrower
Download Presentation

EE 312 Final Exam Review

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. EE 312 Final Exam Review

  2. Exam Format • 165 Total Points • 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? intfoo = 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 • 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 • 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 • Terminology: path, depth, height, etc. • General Trees vs. Binary Trees • Tree Traversals • Preorder • Inorder • Postorder • Binary Search Trees

  17. Trees (cont.) • Binary Search Tree • 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 • 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 • 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 • 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

More Related