Bubble Sorting with Scheme -
I am working on implementing a bubble sorting algorithm in the plan, and I should say that the functional way of programming is weird Is the concept and I am struggling to understand it a little bit.
I have successfully created a function that will get the biggest value first of all, but it is about all that it does.
(Bubble H '(5109)) (598 7 10)
I am struggling with the help function Whichever requirement is necessary, until a swap has been done completely through the list, the loop.
Here I am where, obviously this is not right, but I think I am on the right track. I know that I can pass through the number of elements in the list, but I am looking for a different solution than that.
(bbba s (ld) (cond ((= (length = 1) (Bubba-assist lst)) (and (bubbaS (BubbaS (Bubba-assist lst))))) ) b> In reference to the implementation of sort-aux
, I referenced ...(defined (bubble L) (if (empty (CDR L)) L (if (<( Car L) (Cadre L) (Cons (Car L) (Bubble-Up (CDR L (Bundle-Sort-Aux NL) (Code (N = 1) (Bubble-Sort-aux NL) () () L) (Others (Bulbul) A-Sort-Ox (- N1) (Bubble L))))
..., this is the simplified syntax:
( Define Bubble HL (Bubble-Sort-Aux (L) L))
With the last bit of syntax Chinese, what you should specify in your question :
(BubbleH '(510 9 7)) & gt; (5 7 8 9 10)
Can survive I & amp; ndash;
Comments
Post a Comment