<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
      <title>025.04.82.Assignment. Collections - Vectors - EmbLogic</title>
      <link>https://www.emblogic.com/forum/categories/025-04-82-assignment-collections-vectors/feed.rss</link>
      <pubDate>Thu, 13 Aug 26 20:15:05 +0530</pubDate>
         <description>025.04.82.Assignment. Collections - Vectors - EmbLogic</description>
   <language>en-CA</language>
   <atom:link href="/forum/discussions/feed.rss" rel="self" type="application/rss+xml" />
		<item>
			<title>C.10. Subarray with Maximum Sum</title>
			<link>https://www.emblogic.com/forum/discussion/2015/c-10-subarray-with-maximum-sum</link>
			<pubDate>Mon, 12 May 2025 04:18:05 +0530</pubDate>
			<dc:creator>pravjot</dc:creator>
			<guid isPermaLink="false">2015@/forum/discussions</guid>
			<description><![CDATA[<h3><span><span><span>Write a program to find the </span><strong><span>maximum sum of a contiguous subarray</span></strong><span> in a vector. This is also known as </span><strong><span>Kadane's Algorithm</span></strong><span>.</span></span></span></h3><h3><span><span><strong><span>Input Example</span></strong><span>:</span></span></span></h3><div><span><span><span>Vector: [-2, 1, -3, 4, -1, 2, 1, -5, 4]</span></span></span></div><h3><span><span><strong><span>Output Example</span></strong><span>:</span></span></span></h3><div><span><span><span>Maximum Sum: 6</span><br /><span>Subarray: [4, -1, 2, 1]</span></span></span></div><blockquote><h3><span><span><strong><span>Hint</span></strong><span>:</span></span></span></h3><div><span><span><span>Use two variables: one to track the current sum and another to track the maximum sum.</span></span></span></div><div><span><span><span>Update the maximum sum whenever the current sum exceeds it.</span></span></span></div><div><span><span><span>If the current sum becomes negative, reset it to 0.</span></span></span></div></blockquote>]]></description>
		</item>
		<item>
			<title>D.9. Nested Vectors: Matrix Operations</title>
			<link>https://www.emblogic.com/forum/discussion/2014/d-9-nested-vectors-matrix-operations</link>
			<pubDate>Mon, 12 May 2025 04:17:43 +0530</pubDate>
			<dc:creator>pravjot</dc:creator>
			<guid isPermaLink="false">2014@/forum/discussions</guid>
			<description><![CDATA[<div><span><span><span>Write a program to represent a 2x3 matrix using a nested vector:</span></span></span></div><div><span><span><span>→ </span><span>Initialize the matrix as [[1, 2, 3], [4, 5, 6]].</span></span></span></div><div><span><span><span><span>→ </span>Print the matrix in a row-column format.</span></span></span></div><div><span><span><span><span>→ </span>Compute the sum of all elements in the matrix.</span></span></span></div><h3><span><span><strong><span>Output Example</span></strong><span>:</span></span></span></h3><div><span><span><span>Matrix:</span><br /><span>1 2 3</span><br /><span>4 5 6</span><br /><span>Sum of all elements: 21</span></span></span></div>]]></description>
		</item>
		<item>
			<title>D.8. Rotating a Vector</title>
			<link>https://www.emblogic.com/forum/discussion/2013/d-8-rotating-a-vector</link>
			<pubDate>Mon, 12 May 2025 04:17:25 +0530</pubDate>
			<dc:creator>pravjot</dc:creator>
			<guid isPermaLink="false">2013@/forum/discussions</guid>
			<description><![CDATA[<h3><br /></h3><div><span><span><span>Write a program to rotate a vector [1, 2, 3, 4, 5]:</span></span></span></div><div><span><span><span><span>→ </span>Left by 2 positions.</span></span></span></div><div><span><span><span><span>→ </span>Right by 2 positions.</span></span></span></div><h3><span><span><strong><span>Output Example</span></strong><span>:</span></span></span></h3><div><span><span><span>Original Vector: [1, 2, 3, 4, 5]</span><br /><span>Rotated Left: [3, 4, 5, 1, 2]</span><br /><span>Rotated Right: [4, 5, 1, 2, 3]</span></span></span></div>]]></description>
		</item>
		<item>
			<title>I.7. Sorting and Removing Duplicates</title>
			<link>https://www.emblogic.com/forum/discussion/2012/i-7-sorting-and-removing-duplicates</link>
			<pubDate>Mon, 12 May 2025 04:16:21 +0530</pubDate>
			<dc:creator>pravjot</dc:creator>
			<guid isPermaLink="false">2012@/forum/discussions</guid>
			<description><![CDATA[<div><div><span><span><span>Write a program that:</span></span></span></div><div><span><span><span>→ </span><span>Creates a vector [5, 3, 8, 3, 1, 5, 6, 8].</span></span></span></div><div><span><span><span><span>→ </span>Sorts the vector in ascending order.</span></span></span></div><div><span><span><span><span>→ </span>Removes duplicate values.</span></span></span></div><h3><span><span><strong><span>Output Example</span></strong><span>:</span></span></span></h3><div><span><span><span>Sorted Vector with Unique Elements: [1, 3, 5, 6, 8]</span></span></span></div></div>]]></description>
		</item>
		<item>
			<title>I.6. Sum and Average of a Vector</title>
			<link>https://www.emblogic.com/forum/discussion/2011/i-6-sum-and-average-of-a-vector</link>
			<pubDate>Mon, 12 May 2025 04:16:05 +0530</pubDate>
			<dc:creator>pravjot</dc:creator>
			<guid isPermaLink="false">2011@/forum/discussions</guid>
			<description><![CDATA[<div><span><span><span>Write a program to compute the sum and average of all the elements in a vector [10, 20, 30, 40, 50].</span></span></span></div><div><span><span><strong><span>Output Example</span></strong><span>:</span></span></span></div><div><span><span><span>Sum: 150</span><br /><span>Average: 30.0</span></span></span></div>]]></description>
		</item>
		<item>
			<title>E.5. Reverse a Vector</title>
			<link>https://www.emblogic.com/forum/discussion/2010/e-5-reverse-a-vector</link>
			<pubDate>Mon, 12 May 2025 04:15:40 +0530</pubDate>
			<dc:creator>pravjot</dc:creator>
			<guid isPermaLink="false">2010@/forum/discussions</guid>
			<description><![CDATA[<div><span><span><span>Write a program to reverse the elements of a vector [1, 2, 3, 4, 5] and print the reversed vector.</span></span></span></div>]]></description>
		</item>
		<item>
			<title>E.4. Filter Even Numbers</title>
			<link>https://www.emblogic.com/forum/discussion/2009/e-4-filter-even-numbers</link>
			<pubDate>Mon, 12 May 2025 04:15:23 +0530</pubDate>
			<dc:creator>pravjot</dc:creator>
			<guid isPermaLink="false">2009@/forum/discussions</guid>
			<description><![CDATA[<h3><br /></h3><div><span><span><span>Write a program to filter and display all the even numbers from a vector [1, 2, 3, 4, 5, 6, 7, 8].</span></span></span></div>]]></description>
		</item>
		<item>
			<title>E.3. Access Vector Elements</title>
			<link>https://www.emblogic.com/forum/discussion/2008/e-3-access-vector-elements</link>
			<pubDate>Mon, 12 May 2025 04:10:56 +0530</pubDate>
			<dc:creator>pravjot</dc:creator>
			<guid isPermaLink="false">2008@/forum/discussions</guid>
			<description><![CDATA[<div><span><span><span>Write a program that accesses elements from a vector. Create a vector [1, 2, 3, 4, 5] and:</span></span></span></div><div><span><span><span><span>→ </span>Print the first and third elements using indexing.</span></span></span></div><div><span><span><span>→ </span><span>Use .get() to safely access the second element, checking for bounds.</span></span></span></div>]]></description>
		</item>
		<item>
			<title>E.2. Add and Remove Elements</title>
			<link>https://www.emblogic.com/forum/discussion/2007/e-2-add-and-remove-elements</link>
			<pubDate>Mon, 12 May 2025 04:10:28 +0530</pubDate>
			<dc:creator>pravjot</dc:creator>
			<guid isPermaLink="false">2007@/forum/discussions</guid>
			<description><![CDATA[<div><span><span><span>Write a program that:</span></span></span></div><div><span><span><span>→ </span><span>Creates an empty vector of type </span><code>&lt;span style=&quot;color:#2f4f4f&quot;&gt;i32&lt;/span&gt;</code><span>.</span></span></span></div><div><span><span><span>→ </span><span>Adds the values 5, 10, 15, 20 to the vector using .push().</span></span></span></div><div><span><span><span>→ </span><span>Removes the last element using .pop() and prints the resulting vector.</span></span></span></div>]]></description>
		</item>
		<item>
			<title>E.1. Create and Print a Vector</title>
			<link>https://www.emblogic.com/forum/discussion/2006/e-1-create-and-print-a-vector</link>
			<pubDate>Mon, 12 May 2025 04:09:55 +0530</pubDate>
			<dc:creator>pravjot</dc:creator>
			<guid isPermaLink="false">2006@/forum/discussions</guid>
			<description><![CDATA[<div><span><span><span>Write a program to create a vector of integers with the values [10, 20, 30, 40, 50]. Print all the elements using a loop.</span></span></span></div>]]></description>
		</item>
   </channel>
</rss>