Are you over 18 and want to see adult content?
More Annotations

Free meal planner, food tracker, and recipe saver
Are you over 18 and want to see adult content?

nigeriacomputers.com - nigeriacomputers Resources and Information.
Are you over 18 and want to see adult content?

å‰åŽŸé«˜ç´šã‚½ãƒ¼ãƒ—ãƒ©ãƒ³ãƒ‰ã€ã‚«ãƒ¢ãƒŸãƒ¼ãƒ«ã€‘オフィシャルサイト
Are you over 18 and want to see adult content?

Clavier arabe plus nouvelle génération des claviers arabes
Are you over 18 and want to see adult content?

A complete backup of consciousmagazine.co
Are you over 18 and want to see adult content?

Diario Franjiverde - Diario digital lÃder en Elche y provincia de Alicante
Are you over 18 and want to see adult content?

Hooked on RC Airplanes - Where flying radio control is more than a Hobby!
Are you over 18 and want to see adult content?

Home » Organización para la Excelencia de la Salud – OES
Are you over 18 and want to see adult content?
Favourite Annotations

HIT ➤ Histaminose Info ✔ DE - EN - FR
Are you over 18 and want to see adult content?

Couples Therapy Retreats or Online Couples Therapy
Are you over 18 and want to see adult content?

Theresa Greenfield - For Iowa
Are you over 18 and want to see adult content?

Saloua International - Import & Export
Are you over 18 and want to see adult content?

Crypto News Flash - News on Bitcoin, Ethereum, Litecoin, EOS, Stellar etc
Are you over 18 and want to see adult content?

Aviation News - General and Corporate Aviation News - 24-7 Industry news
Are you over 18 and want to see adult content?

Keluaran HK - Result dan Data Togel Hongkong Terbaru Hari Ini
Are you over 18 and want to see adult content?
Text
PROGRAMMING PRAXIS
Today’s exercise comes from Stack Overflow:. Given a number N and a set of numbers s = {s1, s2, , sn} where s1 < s2 < < sn < N, remove all multiples of {s1, s2, , sn} from the range 1..N.. You should look at the original post on Stack Overflow. The poster gets the answer wrong (he excludes 3), he get the explanation of his wrong answer wrong (he excludes 10 as a multiple of 2), and 2MAX | PROGRAMMING PRAXIS Today's exercise comes from Stack Overflow: Given an array A consisting of N integers, return the maximum sum of two numbers whose digits add up to an equal sum. If there are not two numbers whose digits have an equal sum, the function should returnGEOTHMETIC MEANDIAN
In the world of Randall Munroe, the geothmetic meandian of any set of positive numbers is computed by iterating three sequences — the arithmetic mean, the geometric mean, and the median — until they converge. For instance, the geothmetic meandian of the set (1,1,2,3,5) is 2.089, computed as follows: 1 2.4 1.9743504858348200 2 2 2 POTHOLES | PROGRAMMING PRAXIS Potholes are marked with an “X” in the road, and also count as 1 unit of length. The task is to take a road of length N and fix all potholes with the fewest possible sections repaired by the machine. The city where I live needs one of those machines. Your task is to write a program that takes a string representing a road and returnsthe
HOARE’S PARTITION
Hoare’s partition concludes by returning the right-side pointer; all items to the left of the pointer, plus the item at the pointer itself, are smaller than all items to the right of the pointer. The partitioning element is somewhere in the left-hand partition, but not necessarily at its end, which requires a change to the recursive callin
DOUBLE DABBLE
Processing the BCD digits (check if >4 and add 3) n times will be a big waste of time, compared to only (ceilling n 3) divisions by ten! On my system double-dabble takes more than double the time of bcd, for 4-digits, 16-bit BCDs. A good friend died a few years ago. He was very interested in programming microprocessors.SQUARE DIGIT CHAINS
Here is the Project Euler version of the problem: A number chain is created by continuously added the square of the digits of a number to form a new number until it has been seen before. For example: 44 → 32 → 13 → 10 → 1 → 1. 85 → 89 → 145 → 42 → 20 → 4 → 16 → 37 → 58 → 89. Therefore any chain that arrives at 1 orPEARSON HASHING
Cryptographic hashes, also called message digests, are ubiquitous in modern cryptography — Brce Schneier calls them "the workhorses of modern cryptography" — used among other things in digital signatures, message authentication codes, as fingerprints to detect duplicate data, and as checksums to detect data corruption. Today we look at a simple example of a hash POLLARD’S RHO ALGORITHM FOR DISCRETE LOGARITHMS l. =. l. 0 + m ( p − 1) / d for some m = 0, 1, , d − 1, which must all be checked until the discrete logarithm is found. Thus, Pollard’s rho algorithm consists of iterating the sequences until a match is found, for which we use Floyd’s cycle-finding algorithm, just as in Pollard’s rho algorithm for factoring integers. MINIMUM STANDARD RANDOM NUMBER GENERATOR In 1988, Stephen K. Park and Keith W. Miller, reacting to the plethora of unsatisfactory random number generators then available, published a linear congruential random number generator that they claimed should be the "minimum standard" for an acceptable random number generator. Twenty-five years later, the situation is only somewhat better, and embarrassingly bad random numberPROGRAMMING PRAXIS
Today’s exercise comes from Stack Overflow:. Given a number N and a set of numbers s = {s1, s2, , sn} where s1 < s2 < < sn < N, remove all multiples of {s1, s2, , sn} from the range 1..N.. You should look at the original post on Stack Overflow. The poster gets the answer wrong (he excludes 3), he get the explanation of his wrong answer wrong (he excludes 10 as a multiple of 2), and 2MAX | PROGRAMMING PRAXIS Today's exercise comes from Stack Overflow: Given an array A consisting of N integers, return the maximum sum of two numbers whose digits add up to an equal sum. If there are not two numbers whose digits have an equal sum, the function should returnGEOTHMETIC MEANDIAN
In the world of Randall Munroe, the geothmetic meandian of any set of positive numbers is computed by iterating three sequences — the arithmetic mean, the geometric mean, and the median — until they converge. For instance, the geothmetic meandian of the set (1,1,2,3,5) is 2.089, computed as follows: 1 2.4 1.9743504858348200 2 2 2 POTHOLES | PROGRAMMING PRAXIS Potholes are marked with an “X” in the road, and also count as 1 unit of length. The task is to take a road of length N and fix all potholes with the fewest possible sections repaired by the machine. The city where I live needs one of those machines. Your task is to write a program that takes a string representing a road and returnsthe
HOARE’S PARTITION
Hoare’s partition concludes by returning the right-side pointer; all items to the left of the pointer, plus the item at the pointer itself, are smaller than all items to the right of the pointer. The partitioning element is somewhere in the left-hand partition, but not necessarily at its end, which requires a change to the recursive callin
DOUBLE DABBLE
Processing the BCD digits (check if >4 and add 3) n times will be a big waste of time, compared to only (ceilling n 3) divisions by ten! On my system double-dabble takes more than double the time of bcd, for 4-digits, 16-bit BCDs. A good friend died a few years ago. He was very interested in programming microprocessors.SQUARE DIGIT CHAINS
Here is the Project Euler version of the problem: A number chain is created by continuously added the square of the digits of a number to form a new number until it has been seen before. For example: 44 → 32 → 13 → 10 → 1 → 1. 85 → 89 → 145 → 42 → 20 → 4 → 16 → 37 → 58 → 89. Therefore any chain that arrives at 1 orPEARSON HASHING
Cryptographic hashes, also called message digests, are ubiquitous in modern cryptography — Brce Schneier calls them "the workhorses of modern cryptography" — used among other things in digital signatures, message authentication codes, as fingerprints to detect duplicate data, and as checksums to detect data corruption. Today we look at a simple example of a hash POLLARD’S RHO ALGORITHM FOR DISCRETE LOGARITHMS l. =. l. 0 + m ( p − 1) / d for some m = 0, 1, , d − 1, which must all be checked until the discrete logarithm is found. Thus, Pollard’s rho algorithm consists of iterating the sequences until a match is found, for which we use Floyd’s cycle-finding algorithm, just as in Pollard’s rho algorithm for factoring integers. MINIMUM STANDARD RANDOM NUMBER GENERATOR In 1988, Stephen K. Park and Keith W. Miller, reacting to the plethora of unsatisfactory random number generators then available, published a linear congruential random number generator that they claimed should be the "minimum standard" for an acceptable random number generator. Twenty-five years later, the situation is only somewhat better, and embarrassingly bad random number JUNE | 2021 | PROGRAMMING PRAXIS Lagarias and Sloane study the “approximate squaring” map f(x) = x⌈x⌉ and its behavior when iterated in this paper.. Consider the fraction x = n / d when n > d > 1; let’s take 8/7 as an example. In the first step, the smallest integer greater than 8/7 (the “ceiling”) is 2, and 8/7 × 2 = 16/7. APPROXIMATE SQUARING Lagarias and Sloane study the "approximate squaring" map f(x) = x⌈x⌉ and its behavior when iterated in this paper. Consider the fraction x = n / d when n > d > 1; let's take 8/7 as an example. In the first step, the smallest integer greater than 8/7 (the "ceiling")is 2, and 8/7
CURIOUS NUMBERS
Here’s another way of directly calculating curious numbers: k-digit A is curious if A*A = A mod 10ᵏ, ie. A*A-A = A* (A-1) = X*10ᵏ = X*5ᵏ*2ᵏ for some X. A and A-1 must be co-prime so 5ᵏ must divide one and 2ᵏ must divide the other, which means that A satisfies: A mod 5ᵏ = 0 and A mod 2ᵏ = 1. or:KAPREKAR NUMBERS
Wolfram’s MathWorld describes Kaprekar numbers like this:. Consider an n-digit number k.Square it and add the right n digits to the left n or n-1 digits.If the resultant sum is k, then k is called a Kaprekar number. For example, 9 is a Kaprekar number since 9 2 = 81 and 8 + 1 = 9 and 297 is a Kaprekar number since 297 2 = 88209 and 88 + 209 = 297.. Your task is to write a function thatNON-ABUNDANT SUMS
It's been a long time since we did an exercise from Project Euler; here is number 23: A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 +STALIN SORT
Stalin Sort is a single-pass sort that operates in O(1) space and O(n) time. Iterate down the list of elements checking if they are in order. Any element which is out of order is sent to the gulag (eliminated from the list). At the end you have a sorted list, though it may notbe
DISCRETE LOGARITHMS
The discrete logarithm problem is to compute the exponent y in the expression x y ≡ n (mod m), given x, n, and m; x and m must be relatively prime, which is usually enforced by taking the modulus m as prime. For instance, in the expression 3 y ≡ 13 (mod 17), the discrete logarithm y = 4, since 3 4 ≡ 13 (mod 17). The discrete logarithm problem is of fundamental importance in some branches SEND + MORE = MONEY, PART 1 A classic puzzle of recreational mathematics is the cryptarithm, where the solver is given a math problem in words and must systematically substitute digits for the letters of the puzzle to form a valid calculation. For instance, the famous cryptarithm SEND + MORE = MONEY is solved as M=1, Y=2, E=5, N=6, D=7, R=8, S=9 TWO QUEUES MAKE A STACK In the previous exercise we implemented queues. Today's exercise will use those queues to solve exercise 10.1-7 from CLRS: Show how to implement a stack using two queues. Analyze the running time of the stack operations. You may assume that the queue operations enqueue, dequeue, and isEmpty are provided. You should provide the stackoperations
LEFTPAD | PROGRAMMING PRAXIS Large portions of the internet failed a few days ago when a program called leftpad, which pads a string to a given length by adding spaces or other characters at the left of the string, was suddenly removed from its repository.The whole episode is sad, and brings nothing but shame on everyone involved (though everyone involved seems to think they acted properly throughout), and all of the webPROGRAMMING PRAXIS
Today’s exercise comes from Stack Overflow:. Given a number N and a set of numbers s = {s1, s2, , sn} where s1 < s2 < < sn < N, remove all multiples of {s1, s2, , sn} from the range 1..N.. You should look at the original post on Stack Overflow. The poster gets the answer wrong (he excludes 3), he get the explanation of his wrong answer wrong (he excludes 10 as a multiple of 2), and 2MAX | PROGRAMMING PRAXIS Today's exercise comes from Stack Overflow: Given an array A consisting of N integers, return the maximum sum of two numbers whose digits add up to an equal sum. If there are not two numbers whose digits have an equal sum, the function should returnGEOTHMETIC MEANDIAN
In the world of Randall Munroe, the geothmetic meandian of any set of positive numbers is computed by iterating three sequences — the arithmetic mean, the geometric mean, and the median — until they converge. For instance, the geothmetic meandian of the set (1,1,2,3,5) is 2.089, computed as follows: 1 2.4 1.9743504858348200 2 2 2 POTHOLES | PROGRAMMING PRAXIS Potholes are marked with an “X” in the road, and also count as 1 unit of length. The task is to take a road of length N and fix all potholes with the fewest possible sections repaired by the machine. The city where I live needs one of those machines. Your task is to write a program that takes a string representing a road and returnsthe
HOARE’S PARTITION
Hoare’s partition concludes by returning the right-side pointer; all items to the left of the pointer, plus the item at the pointer itself, are smaller than all items to the right of the pointer. The partitioning element is somewhere in the left-hand partition, but not necessarily at its end, which requires a change to the recursive callin
DOUBLE DABBLE
Processing the BCD digits (check if >4 and add 3) n times will be a big waste of time, compared to only (ceilling n 3) divisions by ten! On my system double-dabble takes more than double the time of bcd, for 4-digits, 16-bit BCDs. A good friend died a few years ago. He was very interested in programming microprocessors.SQUARE DIGIT CHAINS
Here is the Project Euler version of the problem: A number chain is created by continuously added the square of the digits of a number to form a new number until it has been seen before. For example: 44 → 32 → 13 → 10 → 1 → 1. 85 → 89 → 145 → 42 → 20 → 4 → 16 → 37 → 58 → 89. Therefore any chain that arrives at 1 orPEARSON HASHING
Cryptographic hashes, also called message digests, are ubiquitous in modern cryptography — Brce Schneier calls them "the workhorses of modern cryptography" — used among other things in digital signatures, message authentication codes, as fingerprints to detect duplicate data, and as checksums to detect data corruption. Today we look at a simple example of a hash POLLARD’S RHO ALGORITHM FOR DISCRETE LOGARITHMS l. =. l. 0 + m ( p − 1) / d for some m = 0, 1, , d − 1, which must all be checked until the discrete logarithm is found. Thus, Pollard’s rho algorithm consists of iterating the sequences until a match is found, for which we use Floyd’s cycle-finding algorithm, just as in Pollard’s rho algorithm for factoring integers. MINIMUM STANDARD RANDOM NUMBER GENERATOR In 1988, Stephen K. Park and Keith W. Miller, reacting to the plethora of unsatisfactory random number generators then available, published a linear congruential random number generator that they claimed should be the "minimum standard" for an acceptable random number generator. Twenty-five years later, the situation is only somewhat better, and embarrassingly bad random numberPROGRAMMING PRAXIS
Today’s exercise comes from Stack Overflow:. Given a number N and a set of numbers s = {s1, s2, , sn} where s1 < s2 < < sn < N, remove all multiples of {s1, s2, , sn} from the range 1..N.. You should look at the original post on Stack Overflow. The poster gets the answer wrong (he excludes 3), he get the explanation of his wrong answer wrong (he excludes 10 as a multiple of 2), and 2MAX | PROGRAMMING PRAXIS Today's exercise comes from Stack Overflow: Given an array A consisting of N integers, return the maximum sum of two numbers whose digits add up to an equal sum. If there are not two numbers whose digits have an equal sum, the function should returnGEOTHMETIC MEANDIAN
In the world of Randall Munroe, the geothmetic meandian of any set of positive numbers is computed by iterating three sequences — the arithmetic mean, the geometric mean, and the median — until they converge. For instance, the geothmetic meandian of the set (1,1,2,3,5) is 2.089, computed as follows: 1 2.4 1.9743504858348200 2 2 2 POTHOLES | PROGRAMMING PRAXIS Potholes are marked with an “X” in the road, and also count as 1 unit of length. The task is to take a road of length N and fix all potholes with the fewest possible sections repaired by the machine. The city where I live needs one of those machines. Your task is to write a program that takes a string representing a road and returnsthe
HOARE’S PARTITION
Hoare’s partition concludes by returning the right-side pointer; all items to the left of the pointer, plus the item at the pointer itself, are smaller than all items to the right of the pointer. The partitioning element is somewhere in the left-hand partition, but not necessarily at its end, which requires a change to the recursive callin
DOUBLE DABBLE
Processing the BCD digits (check if >4 and add 3) n times will be a big waste of time, compared to only (ceilling n 3) divisions by ten! On my system double-dabble takes more than double the time of bcd, for 4-digits, 16-bit BCDs. A good friend died a few years ago. He was very interested in programming microprocessors.SQUARE DIGIT CHAINS
Here is the Project Euler version of the problem: A number chain is created by continuously added the square of the digits of a number to form a new number until it has been seen before. For example: 44 → 32 → 13 → 10 → 1 → 1. 85 → 89 → 145 → 42 → 20 → 4 → 16 → 37 → 58 → 89. Therefore any chain that arrives at 1 orPEARSON HASHING
Cryptographic hashes, also called message digests, are ubiquitous in modern cryptography — Brce Schneier calls them "the workhorses of modern cryptography" — used among other things in digital signatures, message authentication codes, as fingerprints to detect duplicate data, and as checksums to detect data corruption. Today we look at a simple example of a hash POLLARD’S RHO ALGORITHM FOR DISCRETE LOGARITHMS l. =. l. 0 + m ( p − 1) / d for some m = 0, 1, , d − 1, which must all be checked until the discrete logarithm is found. Thus, Pollard’s rho algorithm consists of iterating the sequences until a match is found, for which we use Floyd’s cycle-finding algorithm, just as in Pollard’s rho algorithm for factoring integers. MINIMUM STANDARD RANDOM NUMBER GENERATOR In 1988, Stephen K. Park and Keith W. Miller, reacting to the plethora of unsatisfactory random number generators then available, published a linear congruential random number generator that they claimed should be the "minimum standard" for an acceptable random number generator. Twenty-five years later, the situation is only somewhat better, and embarrassingly bad random number JUNE | 2021 | PROGRAMMING PRAXIS Lagarias and Sloane study the “approximate squaring” map f(x) = x⌈x⌉ and its behavior when iterated in this paper.. Consider the fraction x = n / d when n > d > 1; let’s take 8/7 as an example. In the first step, the smallest integer greater than 8/7 (the “ceiling”) is 2, and 8/7 × 2 = 16/7. APPROXIMATE SQUARING Lagarias and Sloane study the "approximate squaring" map f(x) = x⌈x⌉ and its behavior when iterated in this paper. Consider the fraction x = n / d when n > d > 1; let's take 8/7 as an example. In the first step, the smallest integer greater than 8/7 (the "ceiling")is 2, and 8/7
CURIOUS NUMBERS
Here’s another way of directly calculating curious numbers: k-digit A is curious if A*A = A mod 10ᵏ, ie. A*A-A = A* (A-1) = X*10ᵏ = X*5ᵏ*2ᵏ for some X. A and A-1 must be co-prime so 5ᵏ must divide one and 2ᵏ must divide the other, which means that A satisfies: A mod 5ᵏ = 0 and A mod 2ᵏ = 1. or:KAPREKAR NUMBERS
Wolfram’s MathWorld describes Kaprekar numbers like this:. Consider an n-digit number k.Square it and add the right n digits to the left n or n-1 digits.If the resultant sum is k, then k is called a Kaprekar number. For example, 9 is a Kaprekar number since 9 2 = 81 and 8 + 1 = 9 and 297 is a Kaprekar number since 297 2 = 88209 and 88 + 209 = 297.. Your task is to write a function thatNON-ABUNDANT SUMS
It's been a long time since we did an exercise from Project Euler; here is number 23: A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 +STALIN SORT
Stalin Sort is a single-pass sort that operates in O(1) space and O(n) time. Iterate down the list of elements checking if they are in order. Any element which is out of order is sent to the gulag (eliminated from the list). At the end you have a sorted list, though it may notbe
DISCRETE LOGARITHMS
The discrete logarithm problem is to compute the exponent y in the expression x y ≡ n (mod m), given x, n, and m; x and m must be relatively prime, which is usually enforced by taking the modulus m as prime. For instance, in the expression 3 y ≡ 13 (mod 17), the discrete logarithm y = 4, since 3 4 ≡ 13 (mod 17). The discrete logarithm problem is of fundamental importance in some branches SEND + MORE = MONEY, PART 1 A classic puzzle of recreational mathematics is the cryptarithm, where the solver is given a math problem in words and must systematically substitute digits for the letters of the puzzle to form a valid calculation. For instance, the famous cryptarithm SEND + MORE = MONEY is solved as M=1, Y=2, E=5, N=6, D=7, R=8, S=9 TWO QUEUES MAKE A STACK In the previous exercise we implemented queues. Today's exercise will use those queues to solve exercise 10.1-7 from CLRS: Show how to implement a stack using two queues. Analyze the running time of the stack operations. You may assume that the queue operations enqueue, dequeue, and isEmpty are provided. You should provide the stackoperations
LEFTPAD | PROGRAMMING PRAXIS Large portions of the internet failed a few days ago when a program called leftpad, which pads a string to a given length by adding spaces or other characters at the left of the string, was suddenly removed from its repository.The whole episode is sad, and brings nothing but shame on everyone involved (though everyone involved seems to think they acted properly throughout), and all of the webPROGRAMMING PRAXIS
A collection of etudes, updated weekly, for the education and enjoyment of the savvy programmer* Home
* About
* HOWTO: Posting Source Code* Standard Prelude
* List Utilities
* List Comprehensions* Pattern Matching
* Structures
* Matrices
* Hash Tables
* Dictionaries
* Input/Output
* Strings
* Sorting
* Higher-Order Funcs* Math Functions
* Bits
* Random Numbers
* Control Flow
* Date Arithmetic
* Unit Testing
* Miscellaneous
* Exercises
* Chronological
* Reverse
* Permuted
* Themes
* Search
* Essays
* Contact
2MAX
JUNE 5, 2020
Today’s exercise comes from Stack Overflow:
> Given an array A consisting of N integers, return the maximum sum of > two numbers whose digits add up to an equal sum. If there are not > two numbers whose digits have an equal sum, the function should > return -1. For example, A = would output 93 because > there are two sets of numbers with the same digit-sum, (51, 42) with > a digit-sum of 6 and (17, 71) with a digit-sum of 8, and the first > pair has the maximum sum of two numbers of 93. Your task is to write a program to calculated the requested maximum sum. When you are finished, you are welcome to reador run
a suggested solution, or to post your own solution or discuss the exercise in the comments below.Pages: 1 2
Posted by programmingpraxisFiled in Exercises
3 Comments »
HIDDEN SQUARES
JUNE 2, 2020
We have a simple task today: > A number _n_ may have squares hidden among its digits. For instance, > in the number 1625649, the consecutive digits 1, 4, 9, 16, 25, 49, > 64, 256 and 625 are all squares. Your task is to write a program that takes a positive integer _n_ and finds all of its hidden squares. When you are finished, you arewelcome to read
or run
a suggested solution, or to post your own solution or discuss the exercise in the comments below.Pages: 1 2
Posted by programmingpraxisFiled in Exercises
4 Comments »
DECREASING-INCREASING ARRAYMAY 29, 2020
Today’s task is somebody’s homework: > Given an array of integers, determine if it is in > decreasing-increasing order, with some initial segment of the array > in decreasing order and the remainder of the array in increasing > order. If the array is in decreasing-increasing order, return the > pivot element (the minimum element in the array); otherwise, return > an indication the array is not in decreasing-increasing order. Array > elements may be duplicated. For example, the array (10 10 10 8 8 6 4 > 4 3 12 13 22 31 40 59 68) is in decreasing-increasing order, with > pivot element 3, but the array (1 2 4 8 12 32 64) is not in > decreasing-increasing order. The student who asked the question suggests a solution using binary search that takes O(log _n_) time, but can’t get it to work. Your task is to write a program to determine if an array is in decreasing-increasing order as described above. When you are finished, you are welcome to read or run a suggested solution, or to post your own solution or discuss the exercise in the comments below.Pages: 1
2
Posted by programmingpraxisFiled in Exercises
9 Comments »
PRIME POWER TRIPLES
MAY 22, 2020
Today’s exercise is Project Euler Problem 87:
> The smallest number expressible as the sum of a prime square, prime > cube, and prime fourth power is 28. In fact, there are exactly four > numbers below fifty that can be expressed in such a way:>
> 28 = 22 + 23 + 24 > 33 = 32 + 23 + 24 > 49 = 52 + 23 + 24 > 47 = 22 + 33 + 24>
> How many numbers below fifty million can be expressed as the sum of > a prime square, prime cube, and prime fourth power? Your task is to solve Project Euler 87; in the spirit of Project Euler, show only your code but not the solution. When you are finished, you are welcome to read or run a suggested solution, or to post your own solution or discuss the exercise in the comments below.Pages: 1
2
Posted by programmingpraxisFiled in Exercises
5 Comments »
MINSTACK
MAY 19, 2020
Today’s task is to implement a minstack data structure that provides the normal stack operations push, pop and top and also the operation least which returns the smallest item in the stack without altering the stack in any way. All four operations must operate in O(1) time and O(_n_) space, where _n_ is the size of the stack. Your task is to implement a minstack as described above. When you are finished, you are welcome to reador run
a suggested solution, or to post your own solution or discuss the exercise in the comments below.Pages: 1 2
Posted by programmingpraxisFiled in Exercises
5 Comments »
NTH ITEM IN A LINKED LISTAPRIL 10, 2020
A student recently asked for help on a beginning-programmer forum to write a Scheme program that finds the nth item in a linked list, mimicking the list-ref built-in function. He posted his code, which was awful; I won’t repost it here. Instead of engaging him, I sent a private email suggesting that he consult either his professor or his teaching assistant, as his posted code showed several misconceptions about Scheme. He wrote back, saying he was sure there was only one thing wrong with his code and I could easily point it out. I didn’t respond, as there was far more than one thing wrong with his code. Your task is to write a program to find the nth item in a linked list; your program must be recursive, as was required by the original assignment. When you are finished, you are welcome to read or run a suggested solution, or to post your own solution or discuss the exercise in the comments below.Pages: 1
2
Posted by programmingpraxisFiled in Exercises
11 Comments »
HOMEWORK
APRIL 3, 2020
Today’s exercise is somebody’s homework: > Given positive integers C and N, find N numbers that sum up to C and > the difference between the highest and the lowest of these number > should not be more than one. For example: with C = 26 and N = 7, the > desired output is . Your task is to write a program to solve the student’s homework. When you are finished, you are welcome to reador run
a suggested solution, or to post your own solution or discuss the exercise in the comments below.Pages: 1 2
Posted by programmingpraxisFiled in Exercises
9 Comments »
LIST ROTATION
MARCH 27, 2020
Given a length-_n_ list like (a b c d e), the rotations of the list are the _n_ lists (a b c d e), (b c d e a), (c d e a b), (d e a b c), and (e a b c d), in any order. Your task is to write a program that takes a list and returns its rotations. When you are finished, you are welcome to reador run
a suggested solution, or to post your own solution or discuss the exercise in the comments below.Pages: 1 2
Posted by programmingpraxisFiled in Exercises
13 Comments »
HOMEWORK
MARCH 20, 2020
Today’s exercise is somebody’s homework: > Write a program that displays the digits from 1 to _n_ then back > down to 1; for instance, if _n_ = 5, the program should display > 123454321. You are permitted to use only a single for loop. The questioner did not specify what should happen when _n_ reaches 10, so we will specify 0 < _n_ < 10. Your task is to write the requested program; if you like, think of other ways to write that program. When you are finished, you arewelcome to read
or run
a suggested solution, or to post your own solution or discuss the exercise in the comments below.Pages: 1 2
Posted by programmingpraxisFiled in Exercises
13 Comments »
CSV TO HTML
MARCH 17, 2020
Today’s exercise is another in my continuing escapades in “stealth programming” using awk. I frequently write programs that produce CSV files as output. Most of the time the output file is loaded into Excel by the user. Sometimes the CSV file must be printed as well as loaded into Excel, and I wrote a program to do that in a previous exercise.
I recently had a request to produce the output in HTML format, so I wrote that program yesterday. Your task is to write a that converts a CSV file to HTML output; use whatever conventions make sense to you. When you are finished, you arewelcome to read
a suggested
solution, or to post your own solution or discuss the exercise in thecomments below.
Pages: 1 2
Posted by programmingpraxisFiled in Exercises
4 Comments »
Previous Entries
Older posts
CATEGORIES
* Administrivia
* Exercises
ARCHIVES
* June 2020
* May 2020
* April 2020
* March 2020
* February 2020
* January 2020
* December 2019
* November 2019
* October 2019
* September 2019
* August 2019
* July 2019
* June 2019
* May 2019
* April 2019
* March 2019
* February 2019
* January 2019
* November 2018
* October 2018
* September 2018
* August 2018
* July 2018
* June 2018
* May 2018
* April 2018
* March 2018
* February 2018
* January 2018
* December 2017
* November 2017
* October 2017
* September 2017
* August 2017
* July 2017
* June 2017
* May 2017
* April 2017
* March 2017
* February 2017
* January 2017
* December 2016
* November 2016
* October 2016
* September 2016
* August 2016
* July 2016
* June 2016
* May 2016
* April 2016
* March 2016
* February 2016
* January 2016
* December 2015
* November 2015
* October 2015
* September 2015
* August 2015
* July 2015
* June 2015
* May 2015
* April 2015
* March 2015
* February 2015
* January 2015
* December 2014
* November 2014
* October 2014
* September 2014
* August 2014
* July 2014
* June 2014
* May 2014
* April 2014
* March 2014
* February 2014
* January 2014
* December 2013
* November 2013
* October 2013
* September 2013
* August 2013
* July 2013
* June 2013
* May 2013
* April 2013
* March 2013
* February 2013
* January 2013
* December 2012
* November 2012
* October 2012
* September 2012
* August 2012
* July 2012
* June 2012
* May 2012
* April 2012
* March 2012
* February 2012
* January 2012
* December 2011
* November 2011
* October 2011
* September 2011
* August 2011
* July 2011
* June 2011
* May 2011
* April 2011
* March 2011
* February 2011
* January 2011
* December 2010
* November 2010
* October 2010
* September 2010
* August 2010
* July 2010
* June 2010
* May 2010
* April 2010
* March 2010
* February 2010
* January 2010
* December 2009
* November 2009
* October 2009
* September 2009
* August 2009
* July 2009
* June 2009
* May 2009
* April 2009
* March 2009
* February 2009
June 2020
S
M
T
W
T
F
S
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
May
ARCHIVES
* June 2020
* May 2020
* April 2020
* March 2020
* February 2020
* January 2020
* December 2019
* November 2019
* October 2019
* September 2019
* August 2019
* July 2019
* June 2019
* May 2019
* April 2019
* March 2019
* February 2019
* January 2019
* November 2018
* October 2018
* September 2018
* August 2018
* July 2018
* June 2018
* May 2018
* April 2018
* March 2018
* February 2018
* January 2018
* December 2017
* November 2017
* October 2017
* September 2017
* August 2017
* July 2017
* June 2017
* May 2017
* April 2017
* March 2017
* February 2017
* January 2017
* December 2016
* November 2016
* October 2016
* September 2016
* August 2016
* July 2016
* June 2016
* May 2016
* April 2016
* March 2016
* February 2016
* January 2016
* December 2015
* November 2015
* October 2015
* September 2015
* August 2015
* July 2015
* June 2015
* May 2015
* April 2015
* March 2015
* February 2015
* January 2015
* December 2014
* November 2014
* October 2014
* September 2014
* August 2014
* July 2014
* June 2014
* May 2014
* April 2014
* March 2014
* February 2014
* January 2014
* December 2013
* November 2013
* October 2013
* September 2013
* August 2013
* July 2013
* June 2013
* May 2013
* April 2013
* March 2013
* February 2013
* January 2013
* December 2012
* November 2012
* October 2012
* September 2012
* August 2012
* July 2012
* June 2012
* May 2012
* April 2012
* March 2012
* February 2012
* January 2012
* December 2011
* November 2011
* October 2011
* September 2011
* August 2011
* July 2011
* June 2011
* May 2011
* April 2011
* March 2011
* February 2011
* January 2011
* December 2010
* November 2010
* October 2010
* September 2010
* August 2010
* July 2010
* June 2010
* May 2010
* April 2010
* March 2010
* February 2010
* January 2010
* December 2009
* November 2009
* October 2009
* September 2009
* August 2009
* July 2009
* June 2009
* May 2009
* April 2009
* March 2009
* February 2009
BLOGROLL
* WordPress.com
* WordPress.org
Blog at WordPress.com. Do Not Sell My Personal InformationPost to
Cancel
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use. To find out more, including how to control cookies, see here: CookiePolicy
* Follow
*
* Programming Praxis* Customize
* Follow
* Sign up
* Log in
* Report this content * Manage subscriptions* Collapse this bar
Details
Copyright © 2023 ArchiveBay.com. All rights reserved. Terms of Use | Privacy Policy | DMCA | 2021 | Feedback | Advertising | RSS 2.0