Click here to Skip to main content
15,891,248 members

John N - Professional Profile



Summary

    Blog RSS
20
Authority
13
Debator
0
Enquirer
42
Organiser
138
Participant
0
Author
0
Editor
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Reputation

Weekly Data. Recent events may not appear immediately. For information on Reputation please see the FAQ.

Privileges

Members need to achieve at least one of the given member levels in the given reputation categories in order to perform a given action. For example, to store personal files in your account area you will need to achieve Platinum level in either the Author or Authority category. The "If Owner" column means that owners of an item automatically have the privilege. The member types column lists member types who gain the privilege regardless of their reputation level.

ActionAuthorAuthorityDebatorEditorEnquirerOrganiserParticipantIf OwnerMember Types
Have no restrictions on voting frequencysilversilversilversilver
Bypass spam checks when posting contentsilversilversilversilversilversilvergoldSubEditor, Mentor, Protector, Editor
Store personal files in your account areaplatinumplatinumSubEditor, Editor
Have live hyperlinks in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Have the ability to include a biography in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Edit a Question in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Edit an Answer in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Delete a Question in Q&AYesSubEditor, Protector, Editor
Delete an Answer in Q&AYesSubEditor, Protector, Editor
Report an ArticlesilversilversilversilverSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending ArticlegoldgoldgoldgoldSubEditor, Mentor, Protector, Editor
Edit other members' articlesSubEditor, Protector, Editor
Create an article without requiring moderationplatinumSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending QuestionProtector
Approve/Disapprove a pending AnswerProtector
Report a forum messagesilversilverbronzeProtector, Editor
Approve/Disapprove a pending Forum MessageProtector
Have the ability to send direct emails to members in the forumsProtector
Create a new tagsilversilversilversilver
Modify a tagsilversilversilversilver

Actions with a green tick can be performed by this member.


 
GeneralGroundbreaking is less fun than it sounds Pin
John N6-Dec-04 19:24
John N6-Dec-04 19:24 
GeneralIn-place merge-sort Pin
John N23-Sep-04 12:56
John N23-Sep-04 12:56 
I've seen some other in-place merge-sort algorithms around, and the auxiliary storage requirements are usually the same size as the source list, which, in my opinion, defeats about half the purpose of doing the sort in-place anyway. So I developed this method here:

// [C#]
string[] unsorted = { "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" };
int sz = 1;
while (sz < unsorted.Length)
{
	// Consider a pair of sub-lists.
	for (int n = 0; n < unsorted.Length / sz; n += 2)
	{
		/// For consideration: Are i1 and list1 in fact the same number? Whenever we
		/// increment list1, we also increment i1 and vice versa.
		int list1 = n*sz;
		//int list2 = (n+1)*sz;
		int i1 = list1;
		int i2 = (n+1)*sz;
		// Merge index is list1.
		while (i1 < i2 && i2 < (n+2)*sz && i2 < unsorted.Length)
		{
			if (unsorted[i1].CompareTo(unsorted[i2]) < 0)
			{
				/// Changed indices:
				/// First list (lost an item from the front)
				/// Merge location (always increments)
				i1++;
			}
			else
			{
				// Shuffle up.
				string temp = unsorted[i2];
				for (int i = i2; i > i1; i--)
				{
					unsorted[i] = unsorted[i-1];
				}
				unsorted[list1] = temp;
				/// Changed indices:
				/// First list (shuffled up by one)
				/// Second list (lost an item from the front)
				/// Merge location (always increments)
				i1++;
				i2++;
			}
			list1++;
		}
	}
	sz *= 2;
}


The trade-off, of course, is a bit of performance. By refusing to copy the array externally, we also lose the ability to perform every single item insertion in constant time. This may be a quick way to go when memory is very tight.

John N
GeneralAll-In-One Pin
John N25-Aug-04 19:19
John N25-Aug-04 19:19 
GeneralAre our computers too good? Pin
John N23-Aug-04 15:52
John N23-Aug-04 15:52 
GeneralTurn the handle faster Pin
John N18-Aug-04 14:46
John N18-Aug-04 14:46 
GeneralIncremental Requirements Pin
John N17-Aug-04 15:00
John N17-Aug-04 15:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.