Article View: comp.lang.c.moderated
Article #1980Re: Good C Interview questions?
From: Bruce Wedding
Date: Thu, 15 Feb 1996 03:18
Date: Thu, 15 Feb 1996 03:18
22 lines
1398 bytes
1398 bytes
:>1) You have an array of 100 numbers filled with integer values 1-99
:>in no particular order. It is known that filling is such that every
:>possible number is present in the array at least once.
:>Find the number which is present twice.
:
: Vague. From your wording, it is possible for multiple repeats.
:Other than that, good problem.
Fact 1: The array is filled such that every possible
number is present at least once.
Fact 2: The array is size 100
Fact 3: The array is filled with values from 1-99
Conclusion: Only one number can repeat since for fact 1 to be
true, there will only be one open spot.
[other quoted text snipped. -mod]
Bruce D. Wedding Have Compiler, Will Travel!
Perspicacious Programming Performed Promptly
Katy, Texas, USA, Planet Earth, Milkyway Galaxy, Known Universe
Technical Details
Message-ID:
<4fu8mk$9p0@solutions.solon.com>Path:
arc1-ca.pugleaf.net!solon.com!not-for-mailReferences:
<4ec3vg$lst@solutions.solon.com> <4fa794$2lb@solutions.solon.com> <4fbg44$9rm@solutions.solon.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail From: brucew@phoenix.net (Bruce Wedding) Newsgroups: comp.lang.c.moderated Subject: Re: Good C Interview questions? Date: 14 Feb 1996 21:18:44 -0600 Organization: BranPaul Systems Sender: clc@solutions.solon.com Approved: clc@solutions.solon.com Message-ID: <4fu8mk$9p0@solutions.solon.com> References: <4ec3vg$lst@solutions.solon.com> <4fa794$2lb@solutions.solon.com> <4fbg44$9rm@solutions.solon.com> NNTP-Posting-Host: solutions.solon.com X-Newsreader: Moe's Newsreader