Enable contrast version

Tutor profile: Nafseer K.

Inactive
Nafseer K.
Senior Software Engineer, ex-Amazon
Tutor Satisfaction Guarantee

Questions

Subject: Python Programming

TutorMe
Question:

How to be more memory efficient when processing large lists in Python?

Inactive
Nafseer K.
Answer:

Use Generators instead of creating the full list. For example, instead of the below List comprehension: sum([i * i for i in range(1, 10000001)]) # creates the full list in memory Use the below generator expression: sum((i * i for i in range(1, 10000001)))

Subject: Java Programming

TutorMe
Question:

Can Singleton Design pattern guarantee the creation of only one instance of the object?

Inactive
Nafseer K.
Answer:

No. You can use Java reflections to make the constructor public and then create additional instances of the class.

Subject: Computer Science (General)

TutorMe
Question:

compare HeapSort vs QuickSort vs MergeSort

Inactive
Nafseer K.
Answer:

Theoretically, when comparing worst-case performance, HeapSort and MergeSort (O(nlogn)) fares better than QuickSort (O(n2)). But practically, occurrence of the worst case of QuickSort can be greatly minimized by using Randomization or Median of Medians. Moreover the hidden constant factors of QuickSort is better than the others. To summarize: 1. Use Heap Sort if you want in-place sorting 2. Use Merge Sort if you want stable sort and is OK with being not in-place 3. Use Quick Sort otherwise, but do remember it runs in O(n2) time in worst-case

Contact tutor

Send a message explaining your
needs and Nafseer will reply soon.
Contact Nafseer

Request lesson

Ready now? Request a lesson.
Start Lesson

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 Lesson" 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.
BEST IN CLASS SINCE 2015
TutorMe homepage
Made in California by Zovio
© 2020 TutorMe, LLC
High Contrast Mode
On
Off