I am trying to modify my shell sort algorithm to use Hibbard's increments rather than n/2. I know that Hibbard's increments are 2k - 1, but I can't figure out how to incorporate that into my algorithm. Any suggestions to help me move forward with this? I feel like I just can't figure this one out. Here's the working version of what I have now, which is NOT using Hibbard's increments: [CODE] public void shellSort(int[] array, int lowindex, int highindex, boolean reversed) { int n = highindex - lowindex; int increment; int offset; for (increment = n / 2; increment …

Member Avatar
Member Avatar
+0 forum 4

Hi, I have quite a large CSV file (Around 20,000 rows with about 20 columns) that I am trying to manipulate. Initially I am looking for a way to get out the first 10 or so records after they have been sorted in ascending order on one of the numeric fields. I've thought of loading the file into memory and then sorting it from there using one of PHPs sort functions but as expected, the memory is simply exhausted. My current thoughts on this would be to read line by line attempting to place each record into an array (Which …

Member Avatar
Member Avatar
+0 forum 12

For each of the step (even that specific as what editors and other software to use) included into building an application (for me mostly - web (php-mysql-html-javascript)) I really need tips on how to improve them so I could start working really really fast and be able to generate all the required functions in an application like in one day instead of a week. The problem is when I come up with a nice idea, I start to develop it, but it takes way too long and I get bored of it and throw away. How to prevent (well my …

Member Avatar
Member Avatar
+0 forum 18

Hey guys I had some homework in a Java class on Friday. I completed it so I am not looking for answers (I also don't think it will be graded). I was just curious, as a learning exercise, how would you guys improve this and why? Now remember I'm a java newb so go easy; I still haven't learned what an object is. I'm sure their has to be a better, prettier way of doing this though so I figured I would ask the pros. Here's the code: [CODE]/* * This program generates and prints a * random card from …

Member Avatar
Member Avatar
+1 forum 2

When I use my computer, I often feel that my CPU is under performing. The only time I don't feel like this is when I am using programs or playing games that are made for multi-core processors. This has stopped me from upgrading to i7 simply because I don't know if windows will use it that way I want it too. Maybe I could start a [B]HUGE[/B] debate out of this question. :)

Member Avatar
Member Avatar
+0 forum 1

I am working on an application and would like to be able to calculate the efficiency of various algorithms and choose the best one. The application operates on a list of records that are stored in a file. Operations include adding records, deleting records, and searching for records based on any field in the record. I know that the File I/O and searching has cost and I am having trouble find a balance between them. Is it more desirable to minimize search time or File I/O? For example, I could use the search from the STL, but that would require …

Member Avatar
Member Avatar
+0 forum 3

First off thanks to all the members of daniweb for all there help and support, they've been fantastic. I'm on the last stage of my program and i need a little more help. I am using binary serialization to save information, i don't want to use xml because frankly it looks a lot harder. My problem is i want to incorporated a search bar to search m serialized files however i see no other way to do this then by deserializing all the files and look for keywords. Does anyone have a more efficient way of doing this?

Member Avatar
Member Avatar
+0 forum 2

The End.