hey Manfr3d , can you write me the linecodes for methode: merge ( first left, first right ) thnx
JavaStudent_LA
Posts
-
In-place Merge-Sort with doubly linked list -
In-place Merge-Sort with doubly linked listI think I have a little bit of a Problem with my first Function!!! And I have to say, I hate recursion. OMG, it is goin' to kill me. I haven't worked with recursive functions before. Here is my code for my 1st func.
public DoublyLinkedList mergesort(DoublyLinkedList in, int n) { int middle=(int)Math.floor(n/2); ListElement firstLeft=in.first; ListElement lastLeft=firstLeft; for(int i=0; i
-
In-place Merge-Sort with doubly linked listI asked for little and you gave me a lot of help. I really have to thank you. Im gonna end this assigmend coz it has already spend a lot of my time. Ill give this Pseudocode a try and see what happens. I hope its functional. So I immediatly have a question. Im a little confuzed here: " mergesort ( DLL in, LE first, int n ) { // in: head, first: first list element, n: number of elements as the mergesort function above, except that the trivial case n == 1 must be handled, because this is the break condition for the recursion if n == 1 => in.first = first // in.first means the first element of the list this function also calls the 3-argument version of mergesort // the 2-argument version is just the entry point all list elements must be addressed via the first one, not via the head, the head is just needed for the trivial case to connect the single LE to it recursive calls and merge as above return } " This is very roughly written. I suerly need more explanation on this :confused: .Thnx again
-
In-place Merge-Sort with doubly linked listaghhh, I can't get it finished :-( I've been spending on it my whole day. Hey Manfr3d maybe you can help me with your version-code?
-
In-place Merge-Sort with doubly linked listThis is really an interesting Assingment. Ive worked with MergeSort but I didnt have the Idea before that it could be effectivly implemented with DoublyLinked Lists. I would give this a try. I hope you guys will help me also :) P.S. I want to implement this in C++ with Stack. I think Stack here can do a lot of work :~ do you have any pseudocode, so I start it easily.