Reverse the content of the array
I thought of adding this small code snippets to thelibrary which just reverses the content of the array. Not sort in ascending/descending order, but put last array entry to first, etc. EG.. if array consists of {2,3,4,7,12,98},, need to output {98, 12,7,4,3,2}
Code: CPP

Re: Reverse the content of the array
Your code is very complex. Just update it. by this code.
Code:
#include<stdio.h> 
Re: Reverse the content of the array
I see your one more complex but yes more efficient for ADT's as you are not moving the data but just the pointers.

Re: Reverse the content of the array
Quote:
In my program , a[9] & a[0] , a[8] & a[1], a[7] & a[2] , a[6] & a[3], a[5] & a[4] are swapping by pointer. Not too much efficient but this algorithm can be made generic for string as well as any data type may be user data or may enbuilt. 
Re: Reverse the content of the array
Quote:

Re: Reverse the content of the array
Quote:

Re: Reverse the content of the array
Quote:

Re: Reverse the content of the array
nice

Re: Reverse the content of the array
Hi!
Anyone who can help me how to generate SEO properly?? Also, I need some suggestion for free website hosting.. Thanks a lot.. 
Re: Reverse the content of the array
Hello!
Need some help in working out with this problem using PHP.. Is there anyone who has code for this one????Urgent haha thanks thanks Euclid’s Algorithm: Create a program that will implement Euclid’s GCD (Greatest Common Divisor) algorithm: Assume you wish to find the GCD of 2047 and 391. 1. Divide the larger by the smaller and note the remainder: 2047/391 = (391 X 5) + 92 2. Divide the remainder (92) into the previous divisor (391): 391/92 = (92 X 4) + 23 3. Repeat steps 1 and 2 until the remainder is 1 or zero. 3a Divide the remainder (23) into the previous divisor (92): 92/23 = (23 X 4) + 0 4. When the remainder is zero the last divisor is the GCD! 23 X 89 =2047 and 23 X 17 = 391. Therefore 89/17 = 2047/391 5. When the remainder is 1 the two numbers have NO common divisor and are relatively prime. Example: Assume you wish to find the GCD of 8191 and 1023. 8191/1023 = (1023 X 8) + 7 1023/7 = (7 X 146) + 1 The remainder is 1 therefore these two numbers have NO common divisor! 
All times are GMT +5.5. The time now is 07:27. 