Enable contrast version

Tutor profile: Kevin L.

Kevin L.
Experienced CS Tutor

Questions

Subject: Python Programming

TutorMe
Question:

Which of the following is a valid dictionary in Python? 1. myExample = {‘someItem’=>2, ‘otherItem’=>20} 2. myExample = {‘someItem’: 2, ‘otherItem’: 20} 3. myExample = (‘someItem’=>2, ‘otherItem’=>20) 4. myExample = (‘someItem’: 2, ‘otherItem’: 20)

Kevin L.
Answer:

Only #2 is valid, a dictionary must be declared with curly brackets and a key followed by a colon followed by a value.

Subject: Java Programming

TutorMe
Question:

What is the output of following program and why? public static void main(String ags[]){ String a=”abc”; String b=new String(“abc”); System.out.println(a==b); System.out.println(a.equals(b));

Kevin L.
Answer:

Answer: True, True Although a new string is created with the same characters, both variables point to the same object within the String pool so the first print statement will return True due to the addresses being compared. The second print statement compares the actual values within the strings and returns true as well.

Subject: C Programming

TutorMe
Question:

Explain the different types of memory management within the C programming language.

Kevin L.
Answer:

Static memory allocation: space for the object is provided in the binary at compile-time; these objects have an extent (or lifetime) as long as the binary which contains them is loaded into memory. Automatic memory allocation: temporary objects can be stored on the stack, and this space is automatically freed and reusable after the block in which they are declared is exited. Dynamic memory allocation: blocks of memory of arbitrary size can be requested at run-time using library functions such as malloc from a region of memory called the heap; these blocks persist until subsequently freed for reuse by calling the library function realloc or free

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 GoGuardian
Copyright © 2022. Zorro Holdco, LLC doing business as TutorMe.
All Rights Reserved.
High Contrast Mode
On
Off