logmagic
BAN USERSince the streams are already sorted, the problem domain is not sorting but merging. Take any two streams at one time and perform a simple merge routine. Further merge processing can be made efficient on consideration that the streams are already sorted and tail of one stream may be directly lesser than head of another. Thus the number of times a stream needs to be compared element-wise may be reduced.
- logmagic July 01, 2011Solution:
Based on some assumptions that relates to existence of optimized Hashtable for mapping Names of persons to their Phone numbers, a hashtable implementation seems most memory-efficient, given that it will contain m=1 million phone numbers. Based on a simple Trie that needs to maintain a list of references to the child apart from the appropriate phone number at each node structure, it is almost 4 times as memory-expensive as a hashtable.
If the added side-effects of spell-check or nearest words are not important and only memory and performance are constraints then a optimized hashtable would be my bet.
Solution:
If arrays are sorted then find for the minimum while iterating through each array and stop to find the minimum index for that array and continue doing so for rest of the arrays. At end you get the global minimum.
Sorting and then applying above Solution is less expensive than brute force.
RepAbigailFlores, AT&T Customer service email at A9
I have outstanding creative thinking skills that are helpful for overcoming issues in writing and for coming up with new ...
Repkristenjjimenezk, Analyst at ADP
We Statistical assistants establish and check numerical facts in many different areas of business, government, and industry. Right now I ...
RepJeniferWatts, SEO at Accolite software
I’m Jenifer , working as a press reporter in the USA. I collect, write, or distribute news or other current ...
RepStanPhillips, Animator at AMD
StanPhillips, a Landscape architect . I have been working at Pro Property Maintenance it's almost 10 years . I also help ...
RepSailzaNoel, Front-end Software Engineer at Athena Health
I am Sailza , licensed by the state of Texas under the auspices of the Texas Department of Health’s Board ...
RepTashaGarlo, Blockchain Developer at ASAPInfosystemsPvtLtd
I’m Tasha , working as a press reporter in the USA. I collect, write, or distribute news or other current ...
RepJessicaMoss, Member Technical Staff at Bloomberg LP
Jessica , a technical writer with 5+ years of experience writing high-quality internal and user-facing support. As I love to write ...
Repathenajbarnarda, Android Engineer at ABC TECH SUPPORT
I am a graduate in Civil Engineering with nearly 7 years of experience in planning and implementing technical solutions for ...
RepKayraKing, abc at A9
I am an expert aircraft maintenance engineer with a high degree of technical knowledge and manual dexterity. In my spare ...
RepLucyKaren, Android Engineer at Abs india pvt. ltd.
I am Lucy , a Web Administrator at Oshman's Throughout my professional life, I have proved my qualities multiple times ...
Repmariadbulter222, Android Engineer at ABC TECH SUPPORT
Hey, I am a corporate investigator. I love this work. My hobby like write story and different types of article ...
RepValerieHill, abc at 8x8
I am a highly motivated development and community advocate with over 2 years experience fostering strong community relations product advancements ...
RepEzraDavis, abc at A9
I am a hardworking and disciplined newly-certified architect with internship experience in designing commercial buildings and creating accurate 2D and ...
RepYuvaanMoore, abc at 8x8
I have extensive experience as a newspaper reporter, television news reporter, AM radio talk show host and anchorman for major ...
RepRomiTerry, Member Technical Staff at Cleartrip.com
Romi , a Dynamic Property Manager highly regarded for increasing and maintaining a high level of occupancy adhering to all regulations ...
Repcheryljnewsome, Android Engineer at ABC TECH SUPPORT
Hello, my name is Chery and I am a Graphic designer. We are Graphic Designers create visual concepts to communicate ...
RepJuanitaRiegel, Analyst at ABC TECH SUPPORT
Juanita a dedicated Assistant Event Coordinator adept at managing various corporate events, developing budgets, and recruiting and training new personnel ...
RepDeanSims, Associate at ASU
DeanSims a hardworking Tire builder . expert in this work working at Magna Architectural Design . I am also a part of ...
RepStellaMoore, Analyst at ADP
I am professional and dependable with more than 4 years of experience working at a bakery. I mix ingredients together ...
RepEzraClark, Analyst at 8x8
I am an experienced multimedia journalist with a background in investigative reporting. I work well with photographers and videographers when ...
Sorting is a good place to start. If memory is a constraint then performance is forgone. The best performance as mentioned above by some is O(N). The performance for case when memory is constraint is O(N log N) that further depends on the transfer size in ones system.
- logmagic July 01, 2011