Midterm Exam Study Guide: Java 9

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson
Download our mobile app to listen on the go
Get App

Questions and Answers

What are the two types of complexity discussed for assessing algorithms?

  • Time complexity and Computational complexity
  • Time complexity and Network complexity
  • Time complexity and Space complexity (correct)
  • Space complexity and Memory complexity

If a method's Big-O is stated as O(1) and it also contains a loop, what does this imply about the loop?

  • The loop runs proportionally to the input size.
  • The loop never executes.
  • The loop runs a fixed number of times regardless of input size. (correct)
  • The loop complexity cancels out other complexities in the method.

Which statement accurately describes 'best case', 'worst case', and 'average case' Big-O?

  • Best case describes scenarios with no constraints, worst case assumes maximum constraints, and average case uses random inputs.
  • Best case describes the least efficient algorithm execution, while worst and average cases provide other performance metrics.
  • Best case optimally utilizes resources, worst case results in resource exhaustion, and average case reflects typical scenarios.
  • Best case considers minimum resources, worst case considers maximum resources, and average case is the overall mean. (correct)

What is the formal definition of Big-O?

<p>T(n) is O(F(n)) if there are positive constants c and n0 such that, when n &gt;= n0, T(n) is less than or equal to c * F(n). (A)</p> Signup and view all the answers

When converting functions to Big-O, what is the Big-O of the expression $10n + O(lg(n))$?

<p>O(n) (D)</p> Signup and view all the answers

Which of the following data structures allows for dynamic resizing?

<p>Dynamic Array (B)</p> Signup and view all the answers

What is the primary focus of Section 20.1-20.2?

<p>Hashing Basics (D)</p> Signup and view all the answers

Which option describes a characteristic of a stack data structure?

<p>LIFO (Last In, First Out) principle (B)</p> Signup and view all the answers

Which of the following is NOT a common method of handling collisions in hashing?

<p>Direct Addressing (A)</p> Signup and view all the answers

In tree data structures, what is the purpose of tree traversals?

<p>To visit all nodes systematically (D)</p> Signup and view all the answers

What is a property of a binary tree?

<p>Each node can have at most two children (C)</p> Signup and view all the answers

What is the main concept behind priority queues?

<p>Elements are processed based on priority (C)</p> Signup and view all the answers

Which section discusses recursion in relation to trees?

<p>Section 7.1-7.3 (B)</p> Signup and view all the answers

What is required to bring to the exam in addition to a photo ID?

<p>One side of an 8.5&quot;x11&quot; sheet of handwritten notes (D)</p> Signup and view all the answers

Which coding language should students be comfortable coding in for the exam?

<p>Java 9 or higher (A)</p> Signup and view all the answers

What kind of questions might the non-coding portion of the exam include?

<p>Definitions and readings of code (D)</p> Signup and view all the answers

What should a student do if they do not have a suitable photo ID at the time of the exam?

<p>Take a picture at the exam location that will be required later (C)</p> Signup and view all the answers

What is one suggested method to prepare for the exam?

<p>Make up your own problems (D)</p> Signup and view all the answers

Which type of exam question format is not mentioned as being part of the exam?

<p>Essay (D)</p> Signup and view all the answers

Regarding algorithm analysis, what is expected of students?

<p>Understand the theorems without proof (C)</p> Signup and view all the answers

What is an essential resource mentioned for exam preparation?

<p>Relevant sections of the textbook (D)</p> Signup and view all the answers

Flashcards are hidden until you start studying

Study Notes

Midterm Exam Study Guide

  • Exam Information:

    • The exam will test knowledge of definitions, terminology, code reading, and writing.
    • Expect True/False, multiple-choice, short answers, and coding questions in Java 9 or higher.
    • Code-reading questions may involve understanding code execution flow, determining the status of data structures, and predicting output.
  • Required Materials:

    • Photo ID (GMU ID preferred, but other forms like driver's license, state ID, passport are acceptable)
    • One-sided handwritten note sheet (8.5"x11") or a blank sheet of paper for scratch work
  • Preparation Strategy:

    • Review Examples/Exercises/Warm-ups questions from class
    • Practice exercises from the textbook
    • Create your own practice problems
  • Reading List for Review:

    • Big-O:
      • Chapter 5: Algorithm Analysis
      • Section 5.3: Understand the theorems, but not necessarily their proofs.
    • Lists:
      • Section 6.1-6.3, 6.5: General Lists
      • Chapter 15: Dynamic Array / Array List
      • Chapter 17: Linked List
    • Stacks / Queues / Priority Queues:
      • Section 6.6: Stack/Queue Concepts
      • Chapter 16.1-16.3: Stack/Queue Implementation
      • Section 6.9: Priority Queues
    • Hashing:
      • Section 20.1-20.2: Hashing Basics and Hash Functions
      • Section 20.5: Separate Chaining
      • Section 20.3-20.4: Open Addressing
      • Section 20.6-20.7: Comparisons and Applications
    • Trees:
      • Section 18.1: Tree Basics, Binary Trees
      • Section 7.1-7.3: Recursion
      • Section 18.3-18.4: Tree Recursions, Tree Traversals
  • Purpose of the Study Guide:

    • Self-assess your knowledge by identifying strengths and weaknesses.
    • Use provided resources (notes, textbook) to fill knowledge gaps and review forgotten details.
    • Judge your understanding by comparing your answers to past examples, assignments, and textbook exercises.
  • Importance of self-learning:

    • The study guide is not meant to provide answers, but to facilitate the learning process.
    • Focus on understanding the material, not just memorizing answers.
    • The provided resources offer a wealth of questions and answers. This guide helps you self-assess and identify areas for improvement.
  • Sample Review Questions (not exhaustive):

    Big-O

    • What are the two types of complexity for algorithm analysis?
    • Describe time/space complexity with a real-life example.
    • Convert functions into Big-O notation.
    • Compute time complexity and Big-O for your own code samples, explaining variables.
    • Describe a loop within a method with O(1) Big-O.
    • Explain the difference between best case, worst case, and average case Big-O.
    • Provide the formal definition of Big-O notation.

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

More Like This

Use Quizgecko on...
Browser
Browser