programming-pearls Questions

26

Solved

What is the fastest algorithm for circle shifting array for M positions? For example, [3 4 5 2 3 1 4] shift M = 2 positions should be [1 4 3 4 5 2 3]. Thanks a lot.
Auxiliary asked 18/5, 2009 at 4:55

10

Actually it is the problem #10 of chapter 8 of Programming Pearls 2nd edition. It asked two questions: given an array A[] of integers(positive and nonpositive), how can you find a continuous subarr...
Gerena asked 5/5, 2013 at 20:39

7

Solved

"Programming Pearls" in the column 2 ("AHA! Algorithm") talks about how binary search aids in various processes like sorting, tree traversals. But it mentions that binary seach can be used in "prog...
Willin asked 9/5, 2009 at 19:52

1

Solved

Paraphrasing from in "Programming Pearls" book (about c language on older machines, since book is from the late 90's): Integer arithmetic operations (+, -, *) can take around 10 nano seconds where...
Trivandrum asked 16/1, 2015 at 5:31

6

Solved

Jon Bentley in Column 1 of his book programming pearls introduces a technique for sorting a sequence of non-zero positive integers using bit vectors. I have taken the program bitsort.c from here ...
Pelton asked 26/6, 2009 at 17:23

4

From Section 15.2 of Programming Pearls The C codes can be viewed here: http://www.cs.bell-labs.com/cm/cs/pearls/longdup.c When I implement it in Python using suffix-array: example = open("iliad...
Pussy asked 26/11, 2012 at 6:57

2

Solved

I started reading "Programming Pearls" today and while doing it's exercise I came across this question "How would you implement your own bit vector?". When I looked at the solution it was like this...
Hilarity asked 28/8, 2011 at 2:56

4

It's in the section 2.6 and problem 2, the original problem is like this: "Given a sequential file containing 4,300,000,000 32-bit integers, how can you find one that appears at least twice?" My ...
Diecious asked 2/4, 2011 at 6:56

2

Solved

I just can't seem to understand how this would work. Question: Given a sequential file that contains at most four billion 32 bit integers in random order, find a 32-bit integer that isn't in the f...
Danette asked 16/2, 2011 at 1:28

6

Solved

This is the problem described in Programming pearls. I can not understand binary search method descrbied by the author. Can any one helps to elaborate? Thanks. EDIT: I can understand binary search...
Geostrophic asked 29/10, 2009 at 9:18

4

Solved

I wonder if anyone knows the (optimal?) algorithm for longest recurring non-overlapping sub string. For example, in the string ABADZEDGBADEZ the longest recurring would be "BAD". Incidentally if...
Penetralia asked 24/8, 2009 at 17:39
1

© 2022 - 2024 — McMap. All rights reserved.