CSIT-112 Final Study Guide
32 Questions
4 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What type of relationship does proper inheritance create?

  • Is-A (correct)
  • Has-A
  • Belongs-To
  • Part-Of
  • What is an abstract method?

  • A method that can’t be overridden
  • A method that has at least one parameter
  • A method with a body that performs a function
  • A method that is declared without an implementation (correct)
  • What does polymorphism allow us to define?

  • Constructor methods for every class
  • One interface with different implementations (correct)
  • A method that must always be public
  • Multiple classes with the same name
  • What is the first step in the selection sort strategy?

    <p>Find the smallest value</p> Signup and view all the answers

    What does the compareTo method return if input1 is greater than input2?

    <ul> <li></li> </ul> Signup and view all the answers

    What best defines a search pool?

    <p>A group of items available for searching</p> Signup and view all the answers

    What is the purpose of an abstract class?

    <p>To represent general concepts shared by derived classes</p> Signup and view all the answers

    What is a defining characteristic of a derived class?

    <p>It can have additional features not present in the parent class</p> Signup and view all the answers

    What is the purpose of a try-catch statement in a program?

    <p>To handle exceptions that may occur during program execution</p> Signup and view all the answers

    What does each line in a call stack trace represent?

    <p>The sequence of method calls leading to the exception</p> Signup and view all the answers

    What is exception propagation in programming?

    <p>When an exception moves down the call stack if not caught</p> Signup and view all the answers

    What is the base case in recursion?

    <p>The condition that allows recursion to terminate</p> Signup and view all the answers

    What do the streams System.in, System.out, and System.err represent?

    <p>User inputs, program outputs, and error messages, respectively</p> Signup and view all the answers

    What happens if a recursive function lacks a base case?

    <p>It will result in infinite recursion</p> Signup and view all the answers

    What is the main difference between direct recursion and indirect recursion?

    <p>Direct recursion calls itself, indirect recursion requires another method</p> Signup and view all the answers

    Which of the following is an example of a situation that may cause an exception in a program?

    <p>Attempting to access a negative index in an array</p> Signup and view all the answers

    What characterizes a stable sorting algorithm?

    <p>The original order of equal elements is preserved.</p> Signup and view all the answers

    Which of the following is a key feature of a dynamic data structure?

    <p>It can grow and shrink as needed.</p> Signup and view all the answers

    Which of the following is a characteristic of a stack data structure?

    <p>Elements are added and removed from the same end.</p> Signup and view all the answers

    What does the 'top' function in a stack do?

    <p>Retrieves the top item without removing it.</p> Signup and view all the answers

    How are nodes structured in a doubly linked list compared to a singly linked list?

    <p>A doubly linked list uses two pointers: next and prev.</p> Signup and view all the answers

    What is a collection in the context of data structures?

    <p>An object that serves as a repository for other objects.</p> Signup and view all the answers

    What does 'push' do in a stack?

    <p>Adds an item to the top of the stack.</p> Signup and view all the answers

    Which of the following is NOT a type of data structure that can be created using references?

    <p>Arrays</p> Signup and view all the answers

    What distinguishes the insertion and deletion operations in a queue?

    <p>Insertion is done at the rear, deletion at the front.</p> Signup and view all the answers

    What is a characteristic of a binary tree?

    <p>Each node can have no more than two child nodes.</p> Signup and view all the answers

    Which of the following best describes a lambda function?

    <p>An unnamed short block of code that returns a value.</p> Signup and view all the answers

    What is the difference between a directed graph and an undirected graph?

    <p>Directed graphs have arrows to indicate direction, while undirected graphs do not.</p> Signup and view all the answers

    Which of the following is a valid method to retrieve a value from a map using a key?

    <p>.get()</p> Signup and view all the answers

    What are the two common types of graphs?

    <p>Directed and Undirected</p> Signup and view all the answers

    Which statement is true regarding the attributes of a tree?

    <p>Each tree has edges and children connected to a root.</p> Signup and view all the answers

    What does the policy FIFO stand for in relation to queues?

    <p>First In, First Out</p> Signup and view all the answers

    Study Notes

    CSIT-112 Final Study Guide

    • This final exam covers the entire course, with a focus on the second half.
    • Review all course concepts.

    Lecture 1

    • Inheritance: A fundamental object-oriented technique for creating reusable classes.
    • Original Class References: Parent, Super, Base
    • Derived Class References: Child, Subclass
    • Inheritance Relationship: Is-A

    Lecture 2

    • Transitive Inheritance: A subclass inherits properties from its top-level class (if applicable).
    • Abstract Method: A method declared but with no implementation (a method header)
    • Abstract Class: Represents a general concept shared by derived classes.

    Lecture 4

    • Polymorphism: Defines one interface that can have multiple implementations.
    • Polymorphic Reference: Can change behavior of the method that uses it.

    Lecture 5

    • Sorting: Arranging items in a specific order.
    • Selection Sort Strategy: Finds the smallest item, switches it to the first position, next smallest to position 2, repeating until all are in order

    Lecture 6

    • compareTo Method: Compares two inputs against each other; returning a value that reflects the relationship between the two inputs.
    • compareTo Return Values:
      • input1 < input2: negative value
      • input1 == input2: 0
      • input1 > input2: positive value
    • Insertion Sort Strategy: Reorganizes the elements progressively to place each element in the correct sorted position.

    Lecture 7

    • Search Pool: A group of items.

    Lecture 8

    • Exceptions: Problems/unusual situations occurring in a program (not an error)
    • Exception Scenarios: Errors like dividing by zero, unable to read a file, or an out-of-bounds array index.
    • Call Stack Trace: Displays the method call order leading to the exception, including the method, file, and line number of the error.

    Lecture 9

    • Exception Propagation: An exception thrown from a method propagates (is passed) to higher-level methods in a call stack until it's caught/handled.
    • Throwable Class: A class used in error handling to provide access to an exception. The throw keyword is related to this.

    Lecture 10

    • Standard I/O Streams: System.in, System.out, System.err.
    • System.in: Represents the keyboard input.
    • System.out: Represents the standard output.
    • System.err: Represents error output.

    Lecture 11

    • Recursion: Defining something in terms of itself repeatedly until a base case is reached
    • Base Case: A condition that ends the recursive process.
    • Recursive Problems: Examples of problems solved by recursion covered in the course

    Lecture 12

    • Direct Recursion: A method that calls itself directly.
    • Indirect Recursion: Multiple methods calling each other.

    Lecture 13

    • Collection: An object holding other objects.
    • Stable Sort: Maintains the relative order of equal elements.
    • Unstable Sort: Doesn’t guarantee the relative order of equal elements.
    • Abstract Data Type (ADT): Defined by the operations that can be performed on it and not by its implementation. Fixed size.
    • Dynamic Data Structure: Size can change (grow or shrink) as needed. 
    • References (Pointers): Used to link objects in dynamic structures.
    • Linked Lists: Dynamic linear data structures using nodes connected by references.
    • Graphs: Non-linear structures consisting of nodes (vertices) and edges.

    Lecture 14

    • Stack: A linear data structure where the last item added is the first item removed (LIFO).
    • Enqueue/Dequeue: Operations for inserting and removing from a queue (FIFO).
    • Linked List Operations: Insert, Delete, Search of a linked list.
    • Stacks Compared to Arrays

    Lecture 15

    • Trees and Graphs: Non-linear Data structures
    • Types of Trees: Binary Trees; where all have nodes with a maximum degree of two; Leaf Nodes(no children)

    Lecture 16

    • Maps: Data structures that store key-value pairs.  
    • Map Implementations: TreeMap, HashMap
    • Key-Value Pairs: Unique identifier associated with a data value.
    • Lambda Expressions: Anonymous function definitions often used in collections processing (parameters, ->, body).

    Studying That Suits You

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

    Quiz Team

    Related Documents

    CSIT-112 Final Study Guide PDF

    Description

    Prepare for your CSIT-112 final exam with this comprehensive study guide. Focus on key concepts such as inheritance, polymorphism, and sorting algorithms, drawn from the entire course material, particularly the second half. Review essential definitions and techniques to ensure you're well-prepared for the exam.

    More Like This

    Use Quizgecko on...
    Browser
    Browser