TutorMe homepage
Subjects
PRICING
COURSES
SIGN IN
Start Free Trial
Marc S.
Software Engineer, Ford
Tutor Satisfaction Guarantee
Java Programming
TutorMe
Question:

What is a good example of using <? super T>?

Marc S.
Answer:

<? super RandomClass> refers to a class of type RandomClass or any of RandomClass' super classes. For example if some code is trying to sort a list of vehicles by manufacturer year then the comparison could use the model year field which will be present in all vehicles. So Cars in a list of type List<Car> could be compared with a list of List<Vehicles> if the the comparator took in type <? super Car>.

Software Engineering
TutorMe
Question:

Why is taking time to name variables, functions, and classes so important?

Marc S.
Answer:

Well named variables and functions make for much more readable code. This improves the software by: - Decreasing the need for comments - Increasing ease of comprehension when code is read - Forcing the developer to think about the design - Avoiding common naming pitfalls that are worse than poorly chosen names Code will be read 10 or 100 times for every one time it is edited, as Clean Code expert Bob Martin pointed out. So hard to read code requires explanation in comments, quickly reduces efficiency and creates more bugs. Plus thinking if the name is too long or doesn't fit with how the rest of the code base is named it clear that some part of what is being named should be refactored.

Computer Science (General)
TutorMe
Question:

How is space complexity different from time complexity? Give an example of when space complexity is more important than time complexity.

Marc S.
Answer:

Space and time complexity are both analyzed in similar ways, and using similar notations. They are also both analyzed relative to the input for an algorithm or piece of code. But time complexity refers to the number of operations done during the course of an algorithm while space complexity refers to the amount of space taken up in memory during the course of the algorithm. For example an algorithm running on a small embedded system might sort a very large array of 8 bit integers which take roughly 700KB of the systems 1024KB of memory. A sorting algorithm like bubble sort with a space complexity of O(1) must be chosen or there might not be enough memory to continue running the system.

Send a message explaining your
needs and Marc will reply soon.
Contact Marc
Ready now? Request a lesson.
Start Session
FAQs
What is a lesson?
A lesson is virtual lesson space on our platform where you and a tutor can communicate. You'll have the option to communicate using video/audio as well as text chat. You can also upload documents, edit papers in real time and use our cutting-edge virtual whiteboard.
How do I begin a lesson?
If the tutor is currently online, you can click the "Start Session" button above. If they are offline, you can always send them a message to schedule a lesson.
Who are TutorMe tutors?
Many of our tutors are current college students or recent graduates of top-tier universities like MIT, Harvard and USC. TutorMe has thousands of top-quality tutors available to work with you.