logo
HomeExploreAppsAddBETAFlashcardsBETAQuizzesBETAChatBETALecturesMy profile
PremiumContact usPrivacy and terms
logo
LoginSignupPricing
  1. Home
  2. /
  3. Quizzes
  4. /
  5. Algonquin College
  6. /
  7. CST8130
  8. /
  9. CST8130 - Data Structures - QUIZ

CST8130 - Data Structures - QUIZ

CST8130 · Data Structures

Algonquin College

Questions
26 Questions

Practice 26 questions on CST8130 - Data Structures at Algonquin College. Free AI-generated quiz on uNotes — track your score, retake anytime.

Take this quizView course

Questions

  1. 1In the `CST8130` class constructor, what is the most appropriate way to initialize the `students` array and its elements, considering potential negative input for `max`?
  • 2If a reference, an int, and a float each use 1 byte, and a String object uses 2 bytes, how many bytes are used by `Student [] students = new Student[6];`?
  • 3If a reference, an int, and a float each use 1 byte, and a String object uses 2 bytes, how many bytes are used by `Student newOne = new Student();`?
  • 4What is the Big O efficiency of the following code segment, given that `dolt()` is O(n)? ```java j=n; while (j>0) { dolt(); dolt(); j-=2; } ```
  • 5Which of the following represents the BEST Big O algorithm measurement?
  • 6Which of the following represents the WORST Big O algorithm measurement?
  • 7A `Student` object has `studentNumber = 12345`, `studentName = "Linda Crane"`, and `studentGPA = 2.6`. What will be printed if `me.isEligibleForCoop()` returns false?
  • 8What is the output of `System.out.println(recurse(3));` for the following recursive method? ```java public static int recurse(int x) { if (x<2) return x; else return (x + recurse(x-1)); } ```
  • 9What is the return value of `doThis(4);` for the following method? ```java public static int doThis (int num) { int total = 0; for (int i=0; i<num; i++) { for (int j=0; j<num-i; j++) { total++; } } return total; } ```
  • 10What is the value of `y` after the following statements execute? ```java int x = 5; double y = 4.2 + 3 * x / 2; ```
  • Take this quiz and discover more

    You might also like

    BIO1140 - Principles of Biology - QUIZ

    BIO1140
    Algonquin College
    10 Questions

    CHM1311 - General Chemistry I - QUIZ

    CHM1311
    Algonquin College
    10 Questions

    CST8215 - Introduction to Database - QUIZ

    CST8215
    Algonquin College
    40 Questions

    BIO11 - Biology - QUIZ

    BIO11
    University of N/A
    40 Questions