<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Data Structures on Piotr Kosmowski</title>
    <link>/docs/notes/development/data_structures/</link>
    <description>Recent content in Data Structures on Piotr Kosmowski</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>pl-pl</language><atom:link href="/docs/notes/development/data_structures/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>ArrayList</title>
      <link>/docs/notes/development/data_structures/array_list/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/docs/notes/development/data_structures/array_list/</guid>
      <description>In Java, ArrayList is a part of the Java Collections Framework and is a resizable array implementation of the List interface. It is widely used when you need a dynamic array that can grow and shrink as needed.
For scenarios where the list size changes frequently or insertions/deletions are common in the middle, alternatives like LinkedList or other specialized data structures might be more suitable.
Advantages # Dynamic Resizing: Unlike arrays, ArrayList can grow or shrink dynamically when elements are added or removed, making it more flexible.</description>
    </item>
    
    <item>
      <title>Arrays</title>
      <link>/docs/notes/development/data_structures/arrays/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/docs/notes/development/data_structures/arrays/</guid>
      <description>In Java, arrays are a fundamental data structure used to store elements of the same data type in contiguous memory.
Advantages # Fixed Size: Arrays have a predefined size, which means they allocate a contiguous block of memory. This helps with fast access to elements. Random Access: Arrays allow direct access to any element by index in constant time, making it efficient for reading or writing. Memory Efficiency: Arrays use memory efficiently because they don&amp;rsquo;t require extra overhead like some other data structures (e.</description>
    </item>
    
    <item>
      <title>HashSet</title>
      <link>/docs/notes/development/data_structures/hash_set/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/docs/notes/development/data_structures/hash_set/</guid>
      <description>In Java, a HashSet implements the Set interface. It is backed by a HashMap and is primarily used to store unique elements (no duplicates). Since it uses hashing for its internal implementation, operations like add, remove, and search can be performed in constant time on average.
Advantages # Fast Performance: Most operations like adding, removing, and checking if an element exists have an average time complexity of O(1) due to the underlying hash table.</description>
    </item>
    
    <item>
      <title>LinkedList</title>
      <link>/docs/notes/development/data_structures/linked_list/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/docs/notes/development/data_structures/linked_list/</guid>
      <description>In Java, LinkedList is a part of the Java Collections Framework and implements both the List and Deque interfaces. It is a doubly-linked list, where each element (node) contains references to both the next and previous nodes. This structure makes it well-suited for scenarios where you frequently insert or delete elements from the beginning or middle of the list.
LinkedList in Java is ideal for scenarios where frequent insertions and deletions are needed, especially at the start or middle of the list.</description>
    </item>
    
    <item>
      <title>PriorityQueue</title>
      <link>/docs/notes/development/data_structures/priority_queue/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/docs/notes/development/data_structures/priority_queue/</guid>
      <description>In Java, PriorityQueue is a part of the Java Collections Framework and implements a priority heap. It provides an efficient way to handle elements that need to be processed based on their priority (defined by natural ordering or a custom comparator). Elements are ordered by priority, where the smallest or highest-priority element is always accessible at the head of the queue.
The PriorityQueue is a great data structure for scenarios where elements need to be processed based on priority, such as task scheduling, event-driven systems, or anytime you need to efficiently retrieve the smallest or largest element repeatedly.</description>
    </item>
    
    <item>
      <title>Stack</title>
      <link>/docs/notes/development/data_structures/stack/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/docs/notes/development/data_structures/stack/</guid>
      <description>In Java, Stack is a class that extends Vector and implements a standard Last In First Out (LIFO) stack data structure. It inherits the synchronization properties of Vector, making it thread-safe but with similar performance drawbacks due to synchronization overhead.
Advantages # LIFO Behavior: The stack operates with a Last In First Out order, which is useful in many algorithms and processes, such as parsing expressions, backtracking, or implementing recursive algorithms iteratively.</description>
    </item>
    
    <item>
      <title>TreeSet</title>
      <link>/docs/notes/development/data_structures/tree_set/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/docs/notes/development/data_structures/tree_set/</guid>
      <description>In Java, a TreeSet is a part of the java.util package and implements the NavigableSet interface, which extends SortedSet. Internally, it uses a Red-Black Tree (a self-balancing binary search tree), which ensures that the elements are always stored in sorted order. A TreeSet does not allow duplicate elements and does not permit null values. It is commonly used when you need to maintain a sorted collection, and it provides log-time complexity for basic operations like adding, removing, and searching elements.</description>
    </item>
    
    <item>
      <title>Vector</title>
      <link>/docs/notes/development/data_structures/vector/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/docs/notes/development/data_structures/vector/</guid>
      <description>In Java, Vector is a legacy class that implements a dynamically resizable array, much like ArrayList. It is part of the original Java collections framework but is synchronized, which makes it thread-safe. However, this synchronization introduces overhead, and thus Vector is generally less preferred compared to ArrayList for non-threaded applications.
For modern Java development, Vector is generally replaced by ArrayList in non-threaded applications and by CopyOnWriteArrayList or Collections.synchronizedList() in threaded applications.</description>
    </item>
    
  </channel>
</rss>
