/    Sign up×
Community /Pin to ProfileBookmark

Out-of-Memory error on in-place Quicksort Algo selfimplementaion execute on a table

hi hi,

at first: i have a normal Table with 2 colums and 5000 testrows. If i sort after the second row, my quicksortimplementaion runs perfect. Buuuuut if i use it on my second table, with 5 colums and 1000 rows, i get a “out of memory” error from the internet explorer version 6. I checkt the taskmanager while the algo runs over the 2 columstable and! the ie dont use more mem as normally ?

the algoimplementaion in shortform:

[code]
function quicksort(…)

function partition(…)
yes the default partition function. Here i create only a variable from the pivotobject
var pivot = colums[50%];
on the stack.

function changeRow(…){
Change the content from row 1 with 2. simple with changing the innerHTML values:
for(i = 0; i< row.length;i++)
row1[i].innerHTML = temp[i].innerHTML
description:
you see i have a tempobject. But i create it with var on the stack in the function!
[/code]

As a test i made the pivot global and dont declared it everytime in the function.

[code]
var pivot;
function partition(…)
pivot = …
[/code]

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@SicaineauthorMar 16.2006 — Have you problems with understand my text? ?
Copy linkTweet thisAlerts:
@felgallMar 17.2006 — Why are you implementing your own sort rather than using the one built into the array class?
Copy linkTweet thisAlerts:
@SicaineauthorMar 17.2006 — Oh i see that js allowed me to define a comperatorfunction. Ok i oversight that.

Now i thining over the Problem, to change the values in the 2 dimension in ne comperatorfunction because its not enough to use it on the temparray.
×

Success!

Help @Sicaine spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...