CSIT-112 Final Study Guide
40 Questions
2 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

Which term does NOT refer to the original class in inheritance?

  • Child (correct)
  • Super
  • Parent
  • Base
  • An abstract method has a body.

    False

    What does inheritance create in terms of class relationships?

    Is-A relationship

    The _____ class represents general concepts that derived classes have in common.

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

    Match the sorting algorithms with their descriptions:

    <p>Selection Sort = Finds the smallest value and switches it with the first position Insertion Sort = Builds a sorted array one item at a time Bubble Sort = Repeatedly swaps adjacent elements if they are in the wrong order Quick Sort = Divides the array into smaller sub-arrays based on a pivot element</p> Signup and view all the answers

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

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

    Polymorphism allows us to call the same method with different implementations.

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

    What is the process of arranging a list of items in a particular order called?

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

    A search pool is defined as a group of _____ .

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

    What happens to a method called through a polymorphic reference?

    <p>It executes and can change based on the object type</p> Signup and view all the answers

    What is the primary policy of a queue?

    <p>First in First Out (FIFO)</p> Signup and view all the answers

    A binary tree can have more than two child nodes for a single parent.

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

    What are the two operations associated with a queue?

    <p>Enqueue and Dequeue</p> Signup and view all the answers

    A map establishes a relationship between ____ and ____.

    <p>keys, values</p> Signup and view all the answers

    Match the following data structures with their characteristics:

    <p>Queue = FIFO operation Tree = Hierarchical structure Graph = Connection of nodes without a root Map = Key-value pair relationships</p> Signup and view all the answers

    Which of the following methods is used to add a new entry to a map?

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

    A directed graph consists of vertices connected by arrows.

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

    What is the purpose of a try-catch statement?

    <p>To allow a block of code to be tested for errors during execution</p> Signup and view all the answers

    The throwable class provides access to the keyword 'throw'.

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

    What is a lambda function?

    <p>A short block of code that takes parameters and returns a value.</p> Signup and view all the answers

    What is a base case in recursion?

    <p>The condition that terminates the recursive processing.</p> Signup and view all the answers

    In a graph, the absence of a root makes it a ____ structure.

    <p>non-linear</p> Signup and view all the answers

    What is one of the key limitations of a lambda expression?

    <p>It cannot contain variables.</p> Signup and view all the answers

    The process by which an exception is thrown from the top of the call stack is known as __________.

    <p>exception propagation</p> Signup and view all the answers

    Match the following I/O streams with their descriptions:

    <p>System.out = Represents the console window for output System.in = Represents keyboard input System.err = Represents the console window for error output</p> Signup and view all the answers

    Which of the following scenarios could cause an exception to be thrown?

    <p>Dividing by zero</p> Signup and view all the answers

    Recursion requires at least one base case to function correctly.

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

    What happens if we do not define a base case in a recursive function?

    <p>It leads to infinite recursion.</p> Signup and view all the answers

    Indirect recursion involves __________ invoking itself.

    <p>one method</p> Signup and view all the answers

    What does the call stack trace provide information about?

    <p>The method, file, and line number of the error</p> Signup and view all the answers

    Which of the following describes a stack?

    <p>Last in First Out (LIFO) data structure</p> Signup and view all the answers

    A dynamic data structure can shrink or grow when needed.

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

    What is the primary operation of a queue?

    <p>FIFO (First in First Out)</p> Signup and view all the answers

    In a linked list, each element contains a key and a pointer called ______ that points to its successor.

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

    Match the data structure with its characteristic:

    <p>Stack = LIFO Structure Queue = FIFO Structure Linked List = Dynamic Size Array = Fixed Size</p> Signup and view all the answers

    What is stable sorting?

    <p>Elements with the same value retain their order.</p> Signup and view all the answers

    A dynamic data structure cannot contain references to other objects.

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

    What are two main functions used to maintain a stack?

    <p>Push and Pop</p> Signup and view all the answers

    A static data structure has a fixed ______.

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

    What types of data structures can be built using references?

    <p>Trees, Linked Lists, Graphs</p> Signup and view all the answers

    Study Notes

    CSIT-112 Final Study Guide

    • The final exam will cover the entire course, with a focus on the second half.
    • Students should review all concepts in the guide to prepare thoroughly.

    Lecture 1

    • Inheritance is a fundamental object-oriented design technique for creating and organizing reusable classes.
    • Original classes can be referenced as Parent, Super, or Base.
    • Derived classes can be referenced as Child or Subclass.
    • Proper inheritance creates an "is-a" relationship.

    Lecture 2

    • Inheritance is transitive, meaning a subclass inherits properties from the top class.
    • An abstract method is declared without implementation.
    • Abstract classes represent general concepts shared by derived classes.

    Lecture 4

    • Polymorphism allows defining one interface with multiple implementations.
    • A method called through a polymorphic reference can change its behaviour.

    Lecture 5

    • Sorting arranges items in a specific order.
    • Selection sort finds the smallest value and swaps it with the first position, then repeats.

    Lecture 6

    • The compareTo method compares two inputs and returns a value:
      • Negative if input1 < input2
      • Zero if input1 == input2
      • Positive if input1 > input2
    • Insertion sort is another sorting strategy.

    Lecture 7

    • A search pool is a collection of items.

    Lecture 8

    • Exceptions represent problems or unusual situations in a program.
    • Examples include dividing by zero, file reading errors, and array index issues.
    • Call stack traces display the method calls leading to exceptions, detailing relevant data.

    Lecture 9

    • Try-catch statements allow testing code for potential errors and handle them appropriately.
    • Exception propagation describes how exceptions travel through a program's call stack.

    Lecture 10

    • Input/output streams (system.in, system.out, system.err) handle console interactions.
      • System.in: keyboard input
      • System.out: console output
      • System.err: console error output
    • Recursion defines something in terms of itself.
    • The base case of a recursive solution stops further recursive calls.
    • Recursive methods must have a base case to prevent infinite looping.
    • Recursive solutions can solve complex problems by breaking them into smaller subproblems.

    Lecture 11

    • Recursion is the process of defining something in terms of itself.
    • Problem breakdown into smaller subproblems until the base case is reached.
    • Base case is important for recursive procedures that will otherwise loop infinitely.
    • Recursive problems were covered and examples/details are available for review.
    • Insufficient base case causes infinite recursion.

    Lecture 12

    • Direct recursion is when a function calls itself directly.
    • Indirect recursion is when a function calls another function, which in turn calls the first function.

    Lecture 13

    • Collections are objects that store other objects.
    • Stable sorting maintains the relative order of equal elements in the input data.
    • Unstable sorting does not guarantee this order of equal elements.
    • Abstract data types define data and operations on that data.
    • Static data structures have a fixed size.
    • Dynamic data structures can grow and shrink as needed.
    • References/Pointers relate objects in dynamic data structures.
    • Data structures like trees, lists, graphs can be constructed using references/pointers.

    Lecture 14

    • Stacks are linear dynamic data structures that use LIFO (Last In, First Out) policy.
    • Stacks are used for insertion and deletion.

    Lecture 15

    • Trees and graphs are non-linear data structures.
    • Trees have attributes like nodes, edges, children, parent, root, key.
    • Binary trees are tree structures whose nodes have a maximum of two children.
    • Graphs are non-linear structures and do not have a root.

    Lecture 16

    • Graphs can be directed or undirected.
    • Maps store key-value pairs.
    • Efficient for searching values by keys.
    • TreeMap and HashMap are two common implementations.
    • Lambda expressions are short blocks of code that can be applied to streams of data.
    • Streams provide efficient ways of processing data.
    • Lambda expressions often use parameters and return values to process data.

    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. It covers key concepts from the course, focusing on inheritance, polymorphism, and sorting algorithms. Review these essential topics to ensure you have a solid understanding before the exam.

    More Like This

    Untitled Quiz
    6 questions

    Untitled Quiz

    AdoredHealing avatar
    AdoredHealing
    Untitled Quiz
    37 questions

    Untitled Quiz

    WellReceivedSquirrel7948 avatar
    WellReceivedSquirrel7948
    Untitled Quiz
    55 questions

    Untitled Quiz

    StatuesquePrimrose avatar
    StatuesquePrimrose
    Untitled Quiz
    50 questions

    Untitled Quiz

    JoyousSulfur avatar
    JoyousSulfur
    Use Quizgecko on...
    Browser
    Browser