<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Code on Swayam Blog</title>
    <link>/tags/code/</link>
    <description>Recent content in Code on Swayam Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Sun, 05 Jan 2025 00:00:00 +0000</lastBuildDate><atom:link href="/tags/code/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Basic Overview of DSA</title>
      <link>/posts/dsa/basic-overview-of-dsa/</link>
      <pubDate>Sun, 05 Jan 2025 00:00:00 +0000</pubDate>
      
      <guid>/posts/dsa/basic-overview-of-dsa/</guid>
      <description>&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Arrays&lt;/strong&gt;: Linear data structure with a fixed size, allowing random access to elements.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Best for: Static datasets with frequent element access.&lt;/li&gt;
&lt;li&gt;Complexity:
&lt;ul&gt;
&lt;li&gt;Access: O(1)&lt;/li&gt;
&lt;li&gt;Search: O(n)&lt;/li&gt;
&lt;li&gt;Insertion/Deletion: O(n)
&lt;a href=&#34;/posts/dsa/array/&#34;&gt;Array&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Linked Lists&lt;/strong&gt;: Linear structure of nodes, where each node points to the next.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Types: Singly, Doubly, Circular.&lt;/li&gt;
&lt;li&gt;Best for: Dynamic datasets with frequent insertions/deletions.&lt;/li&gt;
&lt;li&gt;Complexity:
&lt;ul&gt;
&lt;li&gt;Access/Search: O(n)&lt;/li&gt;
&lt;li&gt;Insertion/Deletion: O(1) (at head/tail with pointer)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Hash Maps (or Hash Tables)&lt;/strong&gt;: Key-value pair storage with a hash function.&lt;/p&gt;</description>
      <content>&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Arrays&lt;/strong&gt;: Linear data structure with a fixed size, allowing random access to elements.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Best for: Static datasets with frequent element access.&lt;/li&gt;
&lt;li&gt;Complexity:
&lt;ul&gt;
&lt;li&gt;Access: O(1)&lt;/li&gt;
&lt;li&gt;Search: O(n)&lt;/li&gt;
&lt;li&gt;Insertion/Deletion: O(n)
&lt;a href=&#34;/posts/dsa/array/&#34;&gt;Array&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Linked Lists&lt;/strong&gt;: Linear structure of nodes, where each node points to the next.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Types: Singly, Doubly, Circular.&lt;/li&gt;
&lt;li&gt;Best for: Dynamic datasets with frequent insertions/deletions.&lt;/li&gt;
&lt;li&gt;Complexity:
&lt;ul&gt;
&lt;li&gt;Access/Search: O(n)&lt;/li&gt;
&lt;li&gt;Insertion/Deletion: O(1) (at head/tail with pointer)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Hash Maps (or Hash Tables)&lt;/strong&gt;: Key-value pair storage with a hash function.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Best for: Quick lookup and insertion.&lt;/li&gt;
&lt;li&gt;Complexity:
&lt;ul&gt;
&lt;li&gt;Average: O(1)&lt;/li&gt;
&lt;li&gt;Worst-case: O(n)(due to hash collisions)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Stacks&lt;/strong&gt;: LIFO (Last In, First Out) structure.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Operations: Push, Pop, Peek.&lt;/li&gt;
&lt;li&gt;Best for: Recursive problems, expression evaluation.&lt;/li&gt;
&lt;li&gt;Complexity:
&lt;ul&gt;
&lt;li&gt;Push/Pop/Peek: O(1)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Queues&lt;/strong&gt;: FIFO (First In, First Out) structure.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Variants: Circular Queue, Deque, Priority Queue.&lt;/li&gt;
&lt;li&gt;Best for: Scheduling, buffering.&lt;/li&gt;
&lt;li&gt;Complexity:
&lt;ul&gt;
&lt;li&gt;Enqueue/Dequeue: O(1)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Trees&lt;/strong&gt;: Hierarchical structure with nodes (root, parent, children).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Types: Binary, Binary Search Tree (BST), AVL, Red-Black, etc.&lt;/li&gt;
&lt;li&gt;Best for: Hierarchical data, searching/sorting.&lt;/li&gt;
&lt;li&gt;Complexity:
&lt;ul&gt;
&lt;li&gt;Search/Insert/Delete: O(h), where h is the tree height.&lt;/li&gt;
&lt;li&gt;Balanced trees maintain h=O(logn).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Graphs&lt;/strong&gt;: Collection of nodes (vertices) connected by edges.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Types: Directed, Undirected, Weighted, Unweighted.&lt;/li&gt;
&lt;li&gt;Representation: Adjacency Matrix/List.&lt;/li&gt;
&lt;li&gt;Best for: Network problems, pathfinding.&lt;/li&gt;
&lt;li&gt;Algorithms: DFS, BFS, Dijkstra’s, Prim’s, Kruskal’s.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
</content>
    </item>
    
  </channel>
</rss>
