Skip to main content

Expert answers

Worked answers to common questions

Step-by-step explanations across 15 subjects. Read how a tricky topic breaks down, then bring your own question to a tutor.

Sample answers

These are sample explanations that show the kind of help tutors give. They are examples, not answers from a specific tutor.

2 answers in Computer Science

  • Computer Science

    How do you find the Big-O time complexity of code?

    Count how the number of steps grows as the input size n grows, then keep only the fastest-growing term and drop constants. One loop over n items is O(n), a loop nested inside another is O(n²), and a loop that halves n each time is O(log n). Loops one after another add; loops inside each other multiply.

  • Computer Science

    How does recursion work, and how do you trace a recursive function?

    A recursive function calls itself on a smaller version of the problem until it reaches a base case it can answer directly. Every call waits on the call stack until the one below it returns. factorial(4) calls factorial(3), then 2, 1 and 0, and the answers multiply back up: 1, 1, 2, 6, 24.

Get help that fits your question.

Post your question with no posting fee, compare offers from tutors who know the subject, and choose who to work with.