3. Transitive? Input: a lists of pairs, L. Interpreting the input as a binary relation, return return #T if it is Transitive and #F otherwise 4. Substitute Input: two atoms and a list that might itself contain lists as elements. Substitute will replace every occurrence of the first atom with the second in the list.
Types of Linked List
A sequence of data elements connected through links is called a linked list (LL). The elements of a linked list are nodes containing data and a reference to the next node in the list. In a linked list, the elements are stored in a non-contiguous manner and the linear order in maintained by means of a pointer associated with each node in the list which is used to point to the subsequent node in the list.
Linked List
When a set of items is organized sequentially, it is termed as list. Linked list is a list whose order is given by links from one item to the next. It contains a link to the structure containing the next item so we can say that it is a completely different way to represent a list. In linked list, each structure of the list is known as node and it consists of two fields (one for containing the item and other one is for containing the next item address).
Racket code only please. No loops or use of hash.
Allowed functions are:
1. define, let
2. lambda
3. cons, car, cdr, list, list?, append, empty?, length, equal?
4. and, or, not
5. if, cond
6. map, append-map, andmap, ormap, filter
7. +, -, /, *
8. Functions you implement
![3. Transitive?
Input: a lists of pairs, L. Interpreting the input as a binary relation, return return #T if it is
Transitive and #F otherwise
4. Substitute
Input: two atoms and a list that might itself contain lists as elements. Substitute will
replace every occurrence of the first atom with the second in the list.
Example:
should return
(substitute 'bim 'bam '(a b bim (c d bim e) (f (g h (i bim)) j))
(a b bam (c d bam e) (f (gh (i bam)) j))](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F5c9a0699-fc3c-4659-888d-150a3f9f6bb5%2Fb4de45b6-3c75-42fa-810d-fc35b4b8b3ec%2Fltfachi_processed.jpeg&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 3 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Thank you! Transitive is failing for these cases. Do you have any advice?
(transitive? '((a . b) (b . c) (a . c) (b . d) (a . d) (j . k) (j . l) (k . l))
(transitive? '((a . a) (b . b) (c . d)))
(transitive? '((a . c) (a . b) (b . c) (j . k) (k . j) (j . j) (k . k)))
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)