Services
Discover
Homeschooling
Ask a Question
Log in
Sign up
Filters
Done
Question type:
Essay
Multiple Choice
Short Answer
True False
Matching
Topic
Computing
Study Set
Java Foundations
Quiz 12: Searching and Sorting
Path 4
Access For Free
Share
All types
Filters
Study Flashcards
Practice Exam
Learn
Question 21
Essay
Write a method that accepts an array of integers as a parameter and sorts them using the selection sort algorithm.
Question 22
True/False
To represent constant time complexity we use O(c).
Question 23
True/False
The selection sort algorithm sorts a list of values by repeatedly putting a particular value into its final, sorted position.
Question 24
Essay
Explain how merge sort works.
Question 25
Essay
Write out the state while being sorted using the insertion sort algorithm:
Question 26
Essay
Write a method that accepts an integer array as a parameter and sorts it using the bubble sort algorithm.
Question 27
Essay
Write out the state of the list while being sorted using the selection sort algorithm:
Question 28
Short Answer
What is the complexity of the following code (in terms of the length of the array)? for(int i = 0; i < 5; i++) System.out.println(array[i]);
Question 29
Short Answer
What is the complexity of the following code (in terms of the length of the array), assuming someMethod has a complexity of O(1)? for(int i = 0; i < array.length; i++) for(int j = 0; j < array.length; j++) someMethod(array[j]);