From 65058a0fabbf953fb1e03283a0f7fbed9338142e Mon Sep 17 00:00:00 2001
From: Christian Clauss <cclauss@me.com>
Date: Tue, 24 Oct 2023 10:21:55 +0200
Subject: [PATCH 1/2] Use dataclasses in circular_linked_list.py

---
 .../linked_list/circular_linked_list.py       | 49 ++++++++-----------
 1 file changed, 21 insertions(+), 28 deletions(-)

diff --git a/data_structures/linked_list/circular_linked_list.py b/data_structures/linked_list/circular_linked_list.py
index 54343c80a30f..bb64441d4560 100644
--- a/data_structures/linked_list/circular_linked_list.py
+++ b/data_structures/linked_list/circular_linked_list.py
@@ -1,27 +1,20 @@
 from __future__ import annotations
 
 from collections.abc import Iterator
+from dataclasses import dataclass
 from typing import Any
 
 
+@dataclass
 class Node:
-    def __init__(self, data: Any):
-        """
-        Initialize a new Node with the given data.
-        Args:
-            data: The data to be stored in the node.
-        """
-        self.data: Any = data
-        self.next: Node | None = None  # Reference to the next node
+    data: Any
+    next_node: Node | None = None
 
 
+@dataclass
 class CircularLinkedList:
-    def __init__(self) -> None:
-        """
-        Initialize an empty Circular Linked List.
-        """
-        self.head: Node | None = None  # Reference to the head (first node)
-        self.tail: Node | None = None  # Reference to the tail (last node)
+    head: Node | None = None  # Reference to the head (first node)
+    tail: Node | None = None  # Reference to the tail (last node)
 
     def __iter__(self) -> Iterator[Any]:
         """
@@ -32,7 +25,7 @@ def __iter__(self) -> Iterator[Any]:
         node = self.head
         while node:
             yield node.data
-            node = node.next
+            node = node.next_node
             if node == self.head:
                 break
 
@@ -76,20 +69,20 @@ def insert_nth(self, index: int, data: Any) -> None:
             raise IndexError("list index out of range.")
         new_node: Node = Node(data)
         if self.head is None:
-            new_node.next = new_node  # First node points to itself
+            new_node.next_node = new_node  # First node points to itself
             self.tail = self.head = new_node
         elif index == 0:  # Insert at the head
-            new_node.next = self.head
+            new_node.next_node = self.head
             assert self.tail is not None  # List is not empty, tail exists
-            self.head = self.tail.next = new_node
+            self.head = self.tail.next_node = new_node
         else:
             temp: Node | None = self.head
             for _ in range(index - 1):
                 assert temp is not None
-                temp = temp.next
+                temp = temp.next_node
             assert temp is not None
-            new_node.next = temp.next
-            temp.next = new_node
+            new_node.next_node = temp.next_node
+            temp.next_node = new_node
             if index == len(self) - 1:  # Insert at the tail
                 self.tail = new_node
 
@@ -130,18 +123,18 @@ def delete_nth(self, index: int = 0) -> Any:
         if self.head == self.tail:  # Just one node
             self.head = self.tail = None
         elif index == 0:  # Delete head node
-            assert self.tail.next is not None
-            self.tail.next = self.tail.next.next
-            self.head = self.head.next
+            assert self.tail.next_node is not None
+            self.tail.next_node = self.tail.next_node.next_node
+            self.head = self.head.next_node
         else:
             temp: Node | None = self.head
             for _ in range(index - 1):
                 assert temp is not None
-                temp = temp.next
+                temp = temp.next_node
             assert temp is not None
-            assert temp.next is not None
-            delete_node = temp.next
-            temp.next = temp.next.next
+            assert temp.next_node is not None
+            delete_node = temp.next_node
+            temp.next_node = temp.next_node.next_node
             if index == len(self) - 1:  # Delete at tail
                 self.tail = temp
         return delete_node.data

From 135a59096d3fe9f9a16559b4973ccc0fb8a9a762 Mon Sep 17 00:00:00 2001
From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Date: Tue, 24 Oct 2023 08:22:13 +0000
Subject: [PATCH 2/2] updating DIRECTORY.md

---
 DIRECTORY.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/DIRECTORY.md b/DIRECTORY.md
index f0b1f7c13c2b..5f8eabb6df88 100644
--- a/DIRECTORY.md
+++ b/DIRECTORY.md
@@ -157,6 +157,7 @@
   * [Prefix Conversions](conversions/prefix_conversions.py)
   * [Prefix Conversions String](conversions/prefix_conversions_string.py)
   * [Pressure Conversions](conversions/pressure_conversions.py)
+  * [Rgb Cmyk Conversion](conversions/rgb_cmyk_conversion.py)
   * [Rgb Hsv Conversion](conversions/rgb_hsv_conversion.py)
   * [Roman Numerals](conversions/roman_numerals.py)
   * [Speed Conversions](conversions/speed_conversions.py)
@@ -198,6 +199,7 @@
     * [Lowest Common Ancestor](data_structures/binary_tree/lowest_common_ancestor.py)
     * [Maximum Fenwick Tree](data_structures/binary_tree/maximum_fenwick_tree.py)
     * [Merge Two Binary Trees](data_structures/binary_tree/merge_two_binary_trees.py)
+    * [Mirror Binary Tree](data_structures/binary_tree/mirror_binary_tree.py)
     * [Non Recursive Segment Tree](data_structures/binary_tree/non_recursive_segment_tree.py)
     * [Number Of Possible Binary Trees](data_structures/binary_tree/number_of_possible_binary_trees.py)
     * [Red Black Tree](data_structures/binary_tree/red_black_tree.py)