kottans / kottans/algorithm_club

Skiena 2-45

Open
#29 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

interview question
Dominant language
JavaScript
Stars
14
Forks
14
PR merge metrics
No merged PRs in 30d

Description

Consider the following algorithm to find the minimum element in an array
of numbers A[0,...,n]. One extra variable tmp is allocated to hold the current
minimum value. Start from A[0]; ”tmp” is compared against A[1], A[2], ..., A[N]
in order. When A[i] <tmp, tmp = A[i]. What is the expected number of times that
the assignment operation tmp = A[i] is performed?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the algorithm and assignment condition described in the issue. Done means providing the expected number of assignments together with reasoning based on the array's ordering.

Written by the indexing model from the issue text.

Assessment

Domain
content
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.