This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;pg 102. Ex 3.22.c | |
(defn myfun [x y] (list (list x) y)) | |
(myfun 'alpha 'beta) | |
;.d | |
(defn firstp? [ e collection] (= e (first collection)))--clojure uses ? instead of p for predicate (lisp convention) | |
(firstp? 'foo '(foo bar baz)) | |
(firstp? 'boing '(foo bar baz)) -- clojure has false instead of nil | |
;.e | |
(defn mid-add1 [sentence] (list (first sentence) (+ 1 (second sentence)) (last sentence))) | |
(mid-add1 '(take 2 cookies)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2002 Manu Datta (gmail.com ID Manu dot Datta) | |
# All rights reserved | |
.data | |
msg1: .asciiz "\nEnter integer values followed by return (-1 terminates input): \n" | |
msg2: .asciiz "," | |
msg3: .asciiz "Bubble Sort" | |
msg4: .asciiz "#########pass#########" | |
msg5: .asciiz "\n" | |
msg6: .asciiz "\nNumber list has been sorted\n" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2002 Manu Datta | |
# All rights reserved | |
.data | |
adjMatrix: .space 450 | |
.align 2 | |
count: .space 225 | |
#msg1: .asciiz "Error in toplogical sort:\n" | |
#msg2: .asciiz "graph contanis a cycle\n" | |
msg3: .asciiz "Vertex : " |
NewerOlder