Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 1 out of 3 pages
Exam (elaborations)

CSE 205 Questions And Answers With Latest Study Quiz

Document preview thumbnail
Preview 1 out of 3 pages

CSE 205 Questions And Answers With Latest Study Quiz Comparable interface is inside which of the following Java package? ANS .* Which of the following abstract methods is inside Comparable interface? ANS public int compareTo(Object obj) Comparator interface is inside which of the following Java package? ANS .* Which of the following abstract methods is inside Comparator interface? ANS public int compare(Object o1, Object o2) int compare(Object o1, Object o2) This method compares o1 and o2, and it returns a positive integer if o1 is greater than o2, i.e. in lexicographical order, o1 is after o2. ANS True For the following segment of code, variable result will be a negative number. String x1 = "CSE205"; String x2 = "CSE100"; int result = reTo(x2); ANS False For the following segment of code, variable result will be a negative number. String x1 = "CSE205"; String x2 = "ASU"; int result = reTo(x1); ANS True 32 teams qualified for the 2018 World Cup. If the names of the teams were arranged in sorted order (an array), how many items in the array would binary search have to examine to find the location of a particular team in the array, in the worst case? ANS At most 6 In 2019, there were 193 member states in the United Nations. If the names of these states were stored inside a one dimensional array. About how many names would linear search examine to locate a particular name in the array, in the worst case? ANS No mor

Content preview

CSE 205 Questions And Answers With Latest Study Quiz
Comparable interface is inside which of the following Java package? ANS java.lang.*



Which of the following abstract methods is inside Comparable interface? ANS public int
compareTo(Object obj)



Comparator interface is inside which of the following Java package? ANS java.util.*



Which of the following abstract methods is inside Comparator interface? ANS public int compare(Object
o1, Object o2)


int compare(Object o1, Object o2)
This method compares o1 and o2, and it returns a positive integer if o1 is greater than o2, i.e. in
lexicographical order, o1 is after o2. ANS True



For the following segment of code, variable result will be a negative number.

String x1 = "CSE205";
String x2 = "CSE100";

int result = x1.compareTo(x2); ANS False



For the following segment of code, variable result will be a negative number.
String x1 = "CSE205";
String x2 = "ASU";

int result = x2.compareTo(x1); ANS True



32 teams qualified for the 2018 World Cup. If the names of the teams were arranged in sorted order (an array),
how many items in the array would binary search have to examine to find the location of a particular team in
the array, in the worst case? ANS At most 6



In 2019, there were 193 member states in the United Nations. If the names of these states were stored inside a
one dimensional array. About how many names would linear search examine to locate a particular name in the
array, in the worst case? ANS No more than 193

Document information

Uploaded on
April 16, 2025
Number of pages
3
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$13.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Nipsey
4.1
(377)
Sold
2123
Followers
1528
Items
15240
Last sold
6 days ago




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions