Enable contrast version

Tutor profile: Lok C.

Inactive
Lok C.
MS Computer Science Student at San Jose State University
Tutor Satisfaction Guarantee

Questions

Subject: Javascript Programming

TutorMe
Question:

Why does JS support both == and === instead of just updating == to the current definition of ===?

Inactive
Lok C.
Answer:

JS is made as a language for web development and was made relatively quickly. As such there are some bugs that exist in it to this day. One of those is the intransitive nature of ==. However, due to the fact that JS is a web development language, it is important that any changes made to it doesn't break the existing web. Hence the reason why === was introduced instead of updating ==.

Subject: Discrete Math

TutorMe
Question:

There are 20 students in a school. This school requires all students to join one club. There are a total of 3 clubs, A, B, and C. Clubs can have between 0 to 20 students in them. Students are only allowed in one club. Assuming the students are indistinguishable, how many different ways are there for the students to be arranged in the clubs. With indistinguishable meaning that if student 1 from club A and student 2 from club B swap places, it would still only count as one arrangement.

Inactive
Lok C.
Answer:

The problem is asking for the number of combination of students in clubs. This can be seen as a sum problem. If the number of members in each club can be represented by A,B,and C respectively, then the number of different valid solutions for A + B + C = 20 would give the solution to the problem. One obvious way to solve this is through brute force enumeration. That solution will be omitted as there is another method. Take a smaller problem of 5 students and 2 clubs, the students are represented by O, and the division of clubs be represented by |. So OOOOO| means there are 5 students in club A and |OOOOO means there are 5 students in club B. By choosing the position of the divider we are able to find different arrangement of students in clubs. Thus we can solve this problem by taking the number of students + (number of clubs - 1) and choosing (number of clubs - 1) places. or (N + K -1) C (K-1). Resulting in the answer of 22 C 2 or 231 arrangements.

Subject: Computer Science (General)

TutorMe
Question:

Explain why it is important to learn about different data structures when everything can be implemented with arrays.

Inactive
Lok C.
Answer:

Although different data structures are all just ways to contain data, the way they contain data differently is very important. One can think of different data structures as different types of containers with their own purposes. For example, one shouldn't try to carry water with a woven basket nor try to carry boiling water in a metal cup. In the same way, different data structures specialize in different tasks. Maps are good when one wants 1-1 correspondence between two items, trees are good when a problem can be subdivided, and linked lists are good when one doesn't want to reserve blocks of data ahead of time. To sum it up, it is important to learn about different data structures because it is important to know what tools you have in your toolbox. It is only then when one is capable of solving any problem in front of them.

Contact tutor

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

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
© 2013 - 2021 TutorMe, LLC
High Contrast Mode
On
Off