<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://imabhay.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://imabhay.com/" rel="alternate" type="text/html" /><updated>2025-01-18T02:43:59+00:00</updated><id>https://imabhay.com/feed.xml</id><title type="html">Abhay Singh</title><subtitle>My personal technical blog to track my progress and create knowledge base for computer science.</subtitle><author><name>Abhay Singh</name></author><entry><title type="html">Semester 4 - Distributed System</title><link href="https://imabhay.com/posts/bca/s4-disys-main/" rel="alternate" type="text/html" title="Semester 4 - Distributed System" /><published>2023-06-09T00:00:00+00:00</published><updated>2023-06-09T00:00:00+00:00</updated><id>https://imabhay.com/posts/bca/s4-disys-main</id><content type="html" xml:base="https://imabhay.com/posts/bca/s4-disys-main/"><![CDATA[<p><br /></p>

<p><strong>Course Name</strong>: Distributed System</p>

<h2 id="course-outcomes">Course Outcomes</h2>

<table>
  <thead>
    <tr>
      <th style="text-align: center"> </th>
      <th>Course Outcomes</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td style="text-align: center">1</td>
      <td>To understand data mining process and the resulting patterns, types of data, attributes and knowledge discovery process </td>
    </tr>
    <tr>
      <td style="text-align: center">2</td>
      <td>To study the different data preprocessing techniques before applying the data mining process</td>
    </tr>
    <tr>
      <td style="text-align: center">3</td>
      <td>To characterize the kinds of patterns that can be discovered by association rule mining</td>
    </tr>
    <tr>
      <td style="text-align: center">4</td>
      <td>To learn the different predictions, classification and clustering algorithms</td>
    </tr>
    <tr>
      <td style="text-align: center">5</td>
      <td>To categorize and carefully differentiate between situations for applying different data-mining techniques for different applications.</td>
    </tr>
  </tbody>
</table>

<h2 id="syllabus">Syllabus</h2>

<p><a href="https://docs.google.com/document/d/1JmONZXa7zAxOQDMTXDR5i3-1hYrVPmHTeVX7B4JLDZM/edit?usp=sharing" target="_blank" class="btn btn--primary">Syllabus</a></p>

<h2 id="internals-and-attendance-criteria">Internals and Attendance Criteria</h2>

<table>
  <thead>
    <tr>
      <th>Code</th>
      <th>Course Name</th>
      <th>Attendance Eligibility Criteria</th>
      <th>Internals Criteria (Best is considered)</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>21CSA333A</td>
      <td>Data Mining</td>
      <td>7 Quizzes (LMS)</td>
      <td>7 Quizzes &amp; First 2 Assignments</td>
    </tr>
    <tr>
      <td> </td>
      <td> </td>
      <td> </td>
      <td> </td>
    </tr>
  </tbody>
</table>]]></content><author><name>Abhay Singh</name></author><category term="[&quot;bca&quot;]" /><category term="bca" /><category term="distributed systems" /><category term="distributed" /><summary type="html"><![CDATA[Collection of lecture notes, flashcards, tools, tutorials, and other references.]]></summary></entry><entry><title type="html">Semester 3 - Data Mining - Flashcards</title><link href="https://imabhay.com/posts/bca/s3-mining-flashcard/" rel="alternate" type="text/html" title="Semester 3 - Data Mining - Flashcards" /><published>2023-05-26T00:00:00+00:00</published><updated>2023-05-26T00:00:00+00:00</updated><id>https://imabhay.com/posts/bca/s3-mining-flashcard</id><content type="html" xml:base="https://imabhay.com/posts/bca/s3-mining-flashcard/"><![CDATA[<h2 id="flashcards">Flashcards</h2>

<ul>
  <li><a href="https://quizlet.com/_db2wff?x=1jqt&amp;i=44s59k" target="_blank">Data Mining - All Quizzes Combined</a></li>
</ul>

<p><br /></p>

<p class="notice--info">All flashcards are made and hosted on Quizlet.
<br />For those questions that are image dependent, please flip the flashcard to see the image and answer the question. 
This is because image can’t be attached on the front unlike rear.</p>

<p class="notice--warning">Report via telegram or <a href="mailto:abhaysinghit84@gmail.com; imabhaysec@gmail.com">email</a> if you want to make any corrections.</p>]]></content><author><name>Abhay Singh</name></author><category term="bca" /><category term="bca" /><category term="mining" /><category term="data mining" /><category term="data warehouse" /><summary type="html"><![CDATA[Flashcards for Data Mining]]></summary></entry><entry><title type="html">Semester 3 - Data Mining</title><link href="https://imabhay.com/posts/bca/s3-mining-main/" rel="alternate" type="text/html" title="Semester 3 - Data Mining" /><published>2023-05-26T00:00:00+00:00</published><updated>2023-05-26T00:00:00+00:00</updated><id>https://imabhay.com/posts/bca/s3-mining-main</id><content type="html" xml:base="https://imabhay.com/posts/bca/s3-mining-main/"><![CDATA[<p><br /></p>

<p class="notice--info"><strong>Official Information</strong> <br />
<a href="https://docs.google.com/document/d/1nz3oqO1qjzbaSfY9vX0Yq3j1en6h_qcC_5s5kC_BbTQ/edit?usp=sharing" target="_blank">Important Topics</a></p>

<p><strong>Course Name</strong>: Data Mining</p>

<h2 id="course-outcomes">Course Outcomes</h2>

<table>
  <thead>
    <tr>
      <th style="text-align: center"> </th>
      <th>Course Outcomes</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td style="text-align: center">1</td>
      <td>To understand data mining process and the resulting patterns, types of data, attributes and knowledge discovery process </td>
    </tr>
    <tr>
      <td style="text-align: center">2</td>
      <td>To study the different data preprocessing techniques before applying the data mining process</td>
    </tr>
    <tr>
      <td style="text-align: center">3</td>
      <td>To characterize the kinds of patterns that can be discovered by association rule mining</td>
    </tr>
    <tr>
      <td style="text-align: center">4</td>
      <td>To learn the different predictions, classification and clustering algorithms</td>
    </tr>
    <tr>
      <td style="text-align: center">5</td>
      <td>To categorize and carefully differentiate between situations for applying different data-mining techniques for different applications.</td>
    </tr>
  </tbody>
</table>

<h2 id="syllabus">Syllabus</h2>

<p><a href="https://docs.google.com/document/d/1JmONZXa7zAxOQDMTXDR5i3-1hYrVPmHTeVX7B4JLDZM/edit?usp=sharing" target="_blank" class="btn btn--primary">Syllabus</a></p>

<h2 id="internals-and-attendance-criteria">Internals and Attendance Criteria</h2>

<table>
  <thead>
    <tr>
      <th>Code</th>
      <th>Course Name</th>
      <th>Attendance Eligibility Criteria</th>
      <th>Internals Criteria (Best is considered)</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>21CSA333A</td>
      <td>Data Mining</td>
      <td>7 Quizzes (LMS)</td>
      <td>7 Quizzes &amp; First 2 Assignments</td>
    </tr>
    <tr>
      <td> </td>
      <td> </td>
      <td> </td>
      <td> </td>
    </tr>
  </tbody>
</table>

<h2 id="mock-exam-screens">Mock Exam Screens</h2>

<p><a href="https://drive.google.com/open?id=15BbJ3vS-Ri3vz3_AXflJZBHn4yfSQb0G&amp;usp=drive_fs" target="_blank" class="btn btn--primary">Mock Theory - Screenshots</a></p>]]></content><author><name>Abhay Singh</name></author><category term="[&quot;bca&quot;]" /><category term="bca" /><category term="mining" /><category term="data mining" /><category term="data warehouse" /><summary type="html"><![CDATA[Collection of lecture notes, flashcards, tools, tutorials, and other references.]]></summary></entry><entry><title type="html">Semester 3 - Data Mining (Week 1-4)</title><link href="https://imabhay.com/posts/bca/s3-mining-w1-w4/" rel="alternate" type="text/html" title="Semester 3 - Data Mining (Week 1-4)" /><published>2023-05-26T00:00:00+00:00</published><updated>2023-05-26T00:00:00+00:00</updated><id>https://imabhay.com/posts/bca/s3-mining-w1-w4</id><content type="html" xml:base="https://imabhay.com/posts/bca/s3-mining-w1-w4/"><![CDATA[<h3 id="data-mining">Data Mining</h3>

<ul>
  <li>
    <p>Data Mining, also known as Knowledge Discovery in Database (KDD), is a process used to extract valuable information from large sets of data.</p>
  </li>
  <li>It involves various aspects such as:
    <ul>
      <li>
        <p><strong>Data Types</strong>: Includes relational, transactional, data warehouse data, and complex data types like time-series, sequences, data streams, spatiotemporal data, multimedia data, text data, graphs, social networks, and Web data.</p>
      </li>
      <li>
        <p><strong>Knowledge Mined</strong>: Involves discovering patterns, associations, correlations, and causal structures.</p>
      </li>
      <li>
        <p><strong>Technologies Used</strong>: Incorporates machine learning, statistics, pattern recognition, neural networks, and visualization.</p>
      </li>
      <li>
        <p><strong>Applications</strong>: Extensively used in various fields such as business, science, engineering, and healthcare.</p>
      </li>
    </ul>
  </li>
  <li><strong>Major challenges</strong>
    <ul>
      <li>scalability,</li>
      <li>handling different types of attributes,</li>
      <li>dealing with noisy data, and</li>
      <li>developing incremental clustering algorithms.</li>
    </ul>
  </li>
</ul>

<h3 id="summarize-about-the-steps-in-knowledge-discovery-process">Summarize about the steps in Knowledge Discovery Process</h3>

<p><img src="/assets/images/bca/s3-mining/s3-mining-kdd.png" alt="image-center" class="align-center" width="500" /></p>

<p style="color:gray; font-size: 80%; text-align: center;"><em>Knowledge Discovery Process</em></p>

<ul>
  <li><u>Data Cleaning:</u> Remove noise and inconsistent data.</li>
  <li><u>Data Integration:</u> Combine multiple data sources.</li>
  <li><u>Data Selection:</u> Data relevant to the analysis task are retrieved from the database.</li>
  <li><u>Data Transformation:</u> Consolidate data into mining-friendly formats.</li>
  <li><u>Data Mining:</u> Apply intelligent methods to uncover patterns.</li>
  <li><u>Pattern Evaluation:</u> Identify valuable patterns via interestingness measures.</li>
  <li><u>Knowledge Presentation:</u> Visualization and knowledge representation techniques are used to present the mined knowledge.</li>
</ul>

<h3 id="briefly-summarize-about-transactional-data">Briefly summarize about “Transactional Data”</h3>
<ul>
  <li>Refers to the data that records an exchange, agreement or transfer between entities.</li>
  <li>Captures every system event detail.</li>
  <li>Examples: order delivery, purchase orders, invoices.</li>
</ul>

<h3 id="explain-different-data-mining-functionalities">Explain different Data Mining Functionalities</h3>
<ul>
  <li><u>Characterization/Discrimination:</u> Summarize and contrast data.</li>
  <li><u>Association/Correlation:</u> Find relationships in data.</li>
  <li><u>Classification/Regression:</u> Create data models and predict labels.</li>
  <li><u>Cluster Analysis:</u> Group data into clusters.</li>
  <li><u>Outlier Analysis:</u> Identify non-compliant data.</li>
  <li><u>Trend/Evolution:</u> Describe trends over time.</li>
</ul>

<h3 id="what-is-a-data-warehouse-explain-the-importance-of-dw-in-data-mining-field">What is a “Data Warehouse”? Explain the importance of DW in data mining field.</h3>
<p><br /></p>

<p><img src="/assets/images/bca/s3-mining/s3-mining-warehousing.png" alt="image-center" class="align-center" width="600" /></p>

<p style="color:gray; font-size: 80%; text-align: center;"><em>Three tier data warehousing architecture</em></p>

<p><strong>Data Warehouse</strong></p>
<ul>
  <li>Collects and manages data from various sources.</li>
  <li>Enables strategic data use through a mix of technologies and components.</li>
  <li>Offers consistent business view, irrespective of data source.</li>
  <li>Acts as electronic storage for large information volumes.</li>
  <li>Designed for query and analysis rather than transaction processing.</li>
  <li>Transforms data into information for user analysis.</li>
</ul>

<p><strong>Important reasons for using Data warehouse</strong></p>
<ul>
  <li>Integrates many sources of data and helps to decrease stress on a production system.</li>
  <li>Optimized Data for reading access and consecutive disk scans.</li>
  <li>Data Warehouse helps to protect Data from the source system upgrades.</li>
  <li>Allows users to perform master Data Management.</li>
  <li>Improve data quality in source systems.</li>
</ul>

<h3 id="what-are-the-issues-faced-in-data-mining">What are the issues faced in Data mining?</h3>
<ul>
  <li><u>Mining Methodology:</u> Managing diverse data types, noise, uncertainty, scalability.</li>
  <li><u>User Interaction:</u> Maintaining simplicity, transparency, and user engagement.</li>
  <li><u>Efficiency and Scalability:</u> Ensuring fast, scalable data processing.</li>
  <li><u>Diversity of Database Types:</u> Handling various data types and sources.</li>
  <li><u>Data Mining and Society:</u> Navigating information misuse, privacy, security.</li>
</ul>]]></content><author><name>Abhay Singh</name></author><category term="[&quot;bca&quot;]" /><category term="bca" /><category term="mining" /><category term="data mining" /><category term="data warehouse" /></entry><entry><title type="html">Semester 3 - Data Mining (Week 11-14)</title><link href="https://imabhay.com/posts/bca/s3-mining-w11-w14/" rel="alternate" type="text/html" title="Semester 3 - Data Mining (Week 11-14)" /><published>2023-05-26T00:00:00+00:00</published><updated>2023-05-26T00:00:00+00:00</updated><id>https://imabhay.com/posts/bca/s3-mining-w11-w14</id><content type="html" xml:base="https://imabhay.com/posts/bca/s3-mining-w11-w14/"><![CDATA[<h3 id="classification-and-prediction">Classification and Prediction</h3>

<ul>
  <li><strong>Definition and Purpose</strong>
    <ul>
      <li>Classification: Technique for extracting models or “classifiers” from data.</li>
      <li>Goal: To predict categorical, unordered class labels.</li>
    </ul>
  </li>
  <li><strong>Methodology</strong>
    <ul>
      <li>Various techniques exist for classification, including decision tree, Bayesian, and rule-based classifiers.</li>
      <li>Scalable techniques for large, disk-resident data have been developed recently.</li>
    </ul>
  </li>
  <li><strong>Applications</strong>
    <ul>
      <li>Diverse fields such as fraud detection, target marketing, performance prediction, manufacturing, and medical diagnosis.</li>
    </ul>
  </li>
  <li><strong>Accuracy and Evaluation</strong>
    <ul>
      <li>Various measures evaluate classifiers’ accuracy.</li>
      <li>Techniques ensure reliable accuracy estimates.</li>
    </ul>
  </li>
  <li><strong>Dealing with Challenges</strong>
    <ul>
      <li>Methods exist for increasing accuracy, including strategies for handling imbalanced class data.</li>
    </ul>
  </li>
  <li><strong>Process</strong>
    <ul>
      <li>Classification typically involves a two-step process:
        <ul>
          <li>Building a classification model from previous data.</li>
          <li>Determining the model’s accuracy before deploying it for new data classification.</li>
        </ul>
      </li>
    </ul>
  </li>
</ul>

<h3 id="decision-trees">Decision Trees</h3>

<ul>
  <li><strong>Definition and Purpose</strong>
    <ul>
      <li>Decision Trees: Supervised Machine Learning technique involving data splitting based on parameters.</li>
      <li>Utility: Suitable for both Classification and Regression problems.</li>
    </ul>
  </li>
  <li><strong>Features and Limitations</strong>
    <ul>
      <li>Transparent and easy to interpret.</li>
      <li>Prone to overfitting, particularly with deeper trees.</li>
    </ul>
  </li>
  <li><strong>Algorithms and Techniques</strong>
    <ul>
      <li>Algorithms include ID3, C4.5, CART, among others.</li>
      <li>Use different metrics for attribute split, such as information gain, gain ratio, Gini index.</li>
      <li>Pruning: Technique to reduce overfitting by removing less impactful branches.</li>
    </ul>
  </li>
  <li><strong>Data Compatibility</strong>
    <ul>
      <li>Handles both categorical and numerical data.</li>
      <li>Can manage missing values by inferring the most beneficial outcome.</li>
    </ul>
  </li>
  <li><strong>Further Utilization</strong>
    <ul>
      <li>Serves as foundation for more powerful machine learning algorithms like Random Forest and Gradient Boosting algorithms.</li>
    </ul>
  </li>
</ul>

<h3 id="bayesian-classification">Bayesian Classification:</h3>
<ul>
  <li>Bayesian classification is a type of statistical classification.</li>
  <li>It assumes different parts of data are independent if we know their class.</li>
  <li>This makes calculations easier and can make it the best classifier.</li>
  <li>But, in real-life, data parts can depend on each other.</li>
</ul>

<h4 id="bayesian-belief-networks">Bayesian Belief Networks</h4>
<ul>
  <li>These networks use joint conditional probabilities.</li>
  <li>They let us define independence between certain data parts.</li>
  <li>They offer a visual model of cause-effect links for learning.</li>
  <li>Once trained, they can classify data.</li>
</ul>

<h4 id="components-of-bayesian-belief-networks">Components of Bayesian Belief Networks</h4>
<ul>
  <li>A belief network is made of a graph and probability tables.</li>
  <li>Each point in the graph stands for a random variable.</li>
  <li>Variables can be discrete or continuous.</li>
  <li>They can represent actual data attributes or “hidden variables”.</li>
  <li>Each line shows a probability dependence. If line goes from Y to Z, Y is Z’s parent. Z is a descendant of Y.</li>
</ul>

<h4 id="applications">Applications</h4>
<ul>
  <li>They can classify data and show dependencies among attribute groups.</li>
  <li>For instance, in medical data, a “hidden variable” could point to a syndrome. This syndrome indicates multiple symptoms that define a particular disease.</li>
</ul>

<h3 id="k-nearest-neighbors-knn-algorithm">K-Nearest Neighbors (KNN) Algorithm</h3>

<ul>
  <li><strong>What is KNN?</strong>
    <ul>
      <li>KNN is a simple machine learning algorithm.</li>
      <li>It classifies objects based on the majority vote of its neighbors.</li>
      <li>The object is assigned to the class most common among its ‘K’ closest neighbors.</li>
      <li>‘K’ is usually a small positive number. If K = 1, the object takes the class of its closest neighbor.</li>
    </ul>
  </li>
  <li><strong>Uses of KNN</strong>
    <ul>
      <li>KNN is used for both classification and regression problems.</li>
      <li>It’s mostly used for classification in the industry.</li>
      <li>It uses existing data points classified into groups to predict the classification of new points.</li>
    </ul>
  </li>
  <li><strong>Relation to Real Life</strong>
    <ul>
      <li>Like learning about a person by knowing their friends, KNN uses known data to classify unknown data.</li>
    </ul>
  </li>
  <li><strong>Things to consider before using KNN</strong>
    <ul>
      <li>KNN uses lots of computer power.</li>
      <li>Variables should be normalized to avoid bias.</li>
      <li>Outlier and noise removal is important before using KNN.</li>
    </ul>
  </li>
</ul>

<h3 id="clustering">Clustering</h3>

<h4 id="what-is-clustering">What is Clustering?</h4>
<ul>
  <li>Clustering groups similar data objects together.</li>
  <li>Objects in the same cluster are more alike than those in different clusters.</li>
</ul>

<h4 id="challenges-in-clustering">Challenges in Clustering</h4>

<ol>
  <li><strong>Scalability</strong>:
    <ul>
      <li>Clustering algorithms should work well on large databases with millions or billions of objects.</li>
    </ul>
  </li>
  <li><strong>Different Types of Attributes</strong>:
    <ul>
      <li>Clustering should handle various types of data, such as numeric, binary, categorical, and ordinal.</li>
    </ul>
  </li>
  <li><strong>Clusters with Arbitrary Shape</strong>:
    <ul>
      <li>Clusters can have any shape, so algorithms should detect clusters of different shapes.</li>
    </ul>
  </li>
  <li><strong>Domain Knowledge</strong>:
    <ul>
      <li>Clustering algorithms may require user input, like the number of desired clusters. Finding optimal parameters can be challenging.</li>
    </ul>
  </li>
  <li><strong>Noisy Data</strong>:
    <ul>
      <li>Real-world data often has outliers, missing values, or errors. Robust clustering methods are needed to handle noise.</li>
    </ul>
  </li>
  <li><strong>Incremental Clustering and Insensitivity to Input Order</strong>:
    <ul>
      <li>Clustering algorithms should handle incremental updates and be insensitive to the order of data objects.</li>
    </ul>
  </li>
</ol>

<h4 id="types-of-clustering-methods">Types of clustering methods</h4>

<ol>
  <li><strong>Partitioning methods</strong>:
    <ul>
      <li>Create initial partitions and iteratively improve them.</li>
      <li>Examples: k-means, k-medoids, CLARANS.</li>
    </ul>
  </li>
  <li><strong>Hierarchical methods</strong>:
    <ul>
      <li>Create hierarchical decomposition of data objects.</li>
      <li>Agglomerative (bottom-up) or divisive (top-down) approaches.</li>
      <li>Examples: Chameleon, BIRCH.</li>
    </ul>
  </li>
  <li><strong>Density-based methods</strong>:
    <ul>
      <li>Cluster based on density of objects.</li>
      <li>Grow clusters using neighborhood density or density function.</li>
      <li>Examples: DBSCAN, DENCLUE, OPTICS.</li>
    </ul>
  </li>
  <li><strong>Grid-based methods</strong>:
    <ul>
      <li>Quantize object space into a grid structure.</li>
      <li>Perform clustering on the grid.</li>
      <li>Examples: STING, CLIQUE.</li>
    </ul>
  </li>
</ol>

<h3 id="k-means-algorithm">K-means Algorithm</h3>

<ol>
  <li>K-means algorithm partitions data into K non-overlapping clusters based on nearest mean.</li>
  <li>Randomly choose K cluster centers.</li>
  <li>Assign each data point to the closest cluster center.</li>
  <li>Update cluster centers as the mean of assigned points.</li>
  <li>Repeat steps 3 and 4 until cluster assignments stabilize or reach maximum iterations.</li>
  <li>Result is clusters where each point is closer to its cluster center.</li>
  <li>Suitable for various data types and cluster shapes.</li>
  <li>Requires prior specification of K and sensitive to initial cluster center selection.</li>
  <li>Assumes spherical and evenly sized clusters, which may not always hold.</li>
  <li>Sensitive to outliers, may require data preprocessing.</li>
</ol>

<h3 id="hierarchical-clustering-algorithm">Hierarchical Clustering Algorithm</h3>

<ol>
  <li>Hierarchical clustering is an algorithm that builds a hierarchy of clusters where each node is a cluster consisting of the clusters of its daughter nodes.</li>
  <li>Two types: agglomerative (bottom-up) and divisive (top-down).</li>
  <li>Results presented in a dendrogram.</li>
  <li>No pre-specified number of clusters required.</li>
  <li>Can be used for disjoint cluster partitioning.</li>
  <li>Sensitivity to distance metric and inter-cluster distance calculation methods.</li>
</ol>]]></content><author><name>Abhay Singh</name></author><category term="[&quot;bca&quot;]" /><category term="bca" /><category term="mining" /><category term="data mining" /><category term="data warehouse" /></entry><entry><title type="html">Semester 3 - Data Mining (Week 5-7)</title><link href="https://imabhay.com/posts/bca/s3-mining-w5-w7/" rel="alternate" type="text/html" title="Semester 3 - Data Mining (Week 5-7)" /><published>2023-05-26T00:00:00+00:00</published><updated>2023-05-26T00:00:00+00:00</updated><id>https://imabhay.com/posts/bca/s3-mining-w5-w7</id><content type="html" xml:base="https://imabhay.com/posts/bca/s3-mining-w5-w7/"><![CDATA[<h3 id="explain-the-categorization-of-visualization-methods">Explain the categorization of visualization methods?</h3>

<p><strong>Data Visualization</strong></p>
<ul>
  <li>Graphically represents data for clear communication.</li>
  <li>Used for reporting, managing operations, tracking tasks, and discovering data relationships.</li>
</ul>

<p><strong>Visualization Techniques</strong></p>

<p><img src="/assets/images/bca/s3-mining/s3-mining-pixel.png" alt="image-center" class="align-center" width="400" /></p>

<p style="color:gray; font-size: 80%; text-align: center;"><em>A Pixel-oriented visualization</em></p>

<ul>
  <li><strong>Pixel-Oriented</strong>: Uses color-shaded pixels to reflect data values and analyze correlations.</li>
</ul>

<p><img src="/assets/images/bca/s3-mining/s3-mining-geometric.png" alt="image-center" class="align-center" width="400" /></p>

<p style="color:gray; font-size: 80%; text-align: center;"><em>A Geometric projection visualization</em></p>

<ul>
  <li><strong>Geometric Projection</strong>: Visualizes geometric transformations and projections of multidimensional data.</li>
</ul>

<p><img src="/assets/images/bca/s3-mining/s3-mining-chernoff.png" alt="image-center" class="align-center" width="400" /></p>

<p style="color:gray; font-size: 80%; text-align: center;"><em>A Chernoff faces (Icon-based) visualization</em></p>

<ul>
  <li><strong>Icon-Based</strong>: Uses icons, like Chernoff faces, to represent multidimensional data.
    <ul>
      <li><strong>Chernoff Faces <em>(Icon-Based)</em></strong>
        <ul>
          <li>Cartoon human faces representing up to 18 variables of multidimensional data.</li>
        </ul>
      </li>
    </ul>
  </li>
</ul>

<p><img src="/assets/images/bca/s3-mining/s3-mining-hierarchial.jpg" alt="image-center" class="align-center" width="400" /></p>

<p style="color:gray; font-size: 80%; text-align: center;"><em>A Tree map (Hierarchial) visualization</em></p>

<ul>
  <li><strong>Hierarchical</strong>: Partitions dimensions into subsets visualized hierarchically. Methods include Info cube and screen filling method, Tree maps and Infocube.</li>
</ul>

<p><strong>Visualizing Complex Data and Relations</strong></p>
<ul>
  <li>Techniques now include non-numeric data like text and social networks.</li>
  <li>Tag clouds visualize statistics of user-generated tags.</li>
  <li>Methods exist for visualizing relationships like social networks.</li>
</ul>

<h3 id="what-is-data-quality">What is Data Quality?</h3>
<ul>
  <li>Defined in terms of accuracy, completeness, consistency, timeliness, believability, and interpretability.</li>
  <li>Quality is assessed based on the intended use of the data.</li>
</ul>

<h3 id="factors-affecting-data-quality">Factors Affecting Data Quality</h3>
<ul>
  <li>Poorly designed data entry forms with many optional fields.</li>
  <li>Human and deliberate errors.</li>
  <li>Data decay and inconsistencies.</li>
  <li>Instrumentation and system errors.</li>
  <li>Inadequate data usage.</li>
</ul>

<h3 id="explain-about-data-preprocessing">Explain about Data Preprocessing</h3>
<ul>
  <li>Involves cleaning, integrating, reducing, and transforming data.</li>
  <li>Cleaning fills in missing values, smooths noise, identifies outliers, and corrects inconsistencies.</li>
  <li>Integration merges data from multiple sources.</li>
  <li>Reduction minimizes data size while preserving information.</li>
  <li>Transformation adjusts data for optimal mining.</li>
</ul>

<h3 id="summarize-data-cleaning">Summarize Data Cleaning</h3>
<ul>
  <li>Involves filling missing values, smoothing noise, identifying outliers, and correcting inconsistencies.</li>
  <li>Typically an iterative two-step process: discrepancy detection and data transformation.</li>
</ul>

<h3 id="what-is-integration-of-data">What is Integration of Data?</h3>
<ul>
  <li>Combines data from different sources into one place.</li>
  <li>Involves sorting out differences in meaning, managing data about data, checking relationships, finding and handling duplicate data and conflicts.</li>
</ul>

<h3 id="define-reduction-and-data-transformation">Define Reduction and Data Transformation</h3>
<ul>
  <li>Part of data mining process.</li>
  <li>Aims to decrease data volume while maintaining similar analytical outcomes.</li>
  <li>Simplifies data for easier understanding and interpretation.</li>
  <li>Techniques include reducing dimensions, reducing number of data points, and data compression.</li>
</ul>

<h3 id="what-is-euclidean-distance">What is Euclidean Distance?</h3>
<ul>
  <li>Measures straight line distance between two points in a space.</li>
  <li>Derived from Pythagoras’ theorem, used in data mining and machine learning.</li>
  <li>Calculated using square root of sum of squares of differences in each dimension.</li>
  <li>In 2D space, Euclidean distance between points (x1, y1) and (x2, y2) is sqrt((x2-x1)² + (y2-y1)²).</li>
  <li>In 3D space, it extends to sqrt((x2-x1)² + (y2-y1)² + (z2-z1)²).</li>
  <li>For higher dimensions, it’s sqrt(Σ(xi-yi)²), summing over all dimensions.</li>
</ul>

<h3 id="define-different-distance-measures">Define Different Distance Measures</h3>
<ul>
  <li><u>Euclidean Distance</u>: Straight line distance between two points.</li>
  <li><u>Manhattan Distance</u>: Distance between points along orthogonal axes (grid-based).</li>
  <li><u>Chebyshev Distance</u>: Maximum absolute distance in one dimension.</li>
  <li><u>Minkowski Distance</u>: Generalized metric distance measure with power p.</li>
  <li><u>Hamming Distance</u>: Minimum substitutions to change one string into another.</li>
  <li><u>Mahalanobis Distance</u>: Distance between a point and a distribution.</li>
</ul>

<h3 id="data-similarity-and-dissimilarity">Data Similarity and Dissimilarity</h3>
<ul>
  <li>Data similarity measures the likeness between two data objects.</li>
  <li>It is subjective and defined based on the context.</li>
  <li>Typically represented as a distance, with smaller distances indicating higher similarity.</li>
  <li>Dissimilarity refers to the unlikeness or differences between data objects.</li>
</ul>

<h3 id="define-data-visualization">Define Data Visualization</h3>
<ul>
  <li>Graphical representation of information and data.</li>
  <li>Utilizes various visual tools like charts, graphs, and infographics.</li>
  <li>Facilitates clear and efficient communication of information.</li>
  <li>Enables quick analysis and exploration of large data sets for decision-making.</li>
</ul>

<h3 id="data-discretization">Data Discretization</h3>
<ul>
  <li>Converts continuous data to discrete form.</li>
  <li>Improves data understandability and interpretability.</li>
  <li>Enhances machine learning model performance.</li>
  <li>Methods include binning, histogram analysis, decision trees, and clustering.</li>
</ul>]]></content><author><name>Abhay Singh</name></author><category term="[&quot;bca&quot;]" /><category term="bca" /><category term="mining" /><category term="data mining" /><category term="data warehouse" /></entry><entry><title type="html">Semester 3 - Data Mining (Week 8-10)</title><link href="https://imabhay.com/posts/bca/s3-mining-w8-w10/" rel="alternate" type="text/html" title="Semester 3 - Data Mining (Week 8-10)" /><published>2023-05-26T00:00:00+00:00</published><updated>2023-05-26T00:00:00+00:00</updated><id>https://imabhay.com/posts/bca/s3-mining-w8-w10</id><content type="html" xml:base="https://imabhay.com/posts/bca/s3-mining-w8-w10/"><![CDATA[<h3 id="what-is-frequent-patterns">What is Frequent Patterns?</h3>

<ul>
  <li>Patterns that appear frequently in a dataset.</li>
  <li>Sets of items that commonly occur together in transactions.</li>
  <li>Example: {milk, bread} is a frequent itemset if customers often buy them together.</li>
</ul>

<h3 id="define-frequent-itemset-mining">Define Frequent Itemset Mining</h3>

<ul>
  <li>Identifies and lists itemsets that meet a minimum support threshold.</li>
  <li>Important for tasks like association rule mining and correlation mining.</li>
  <li>Aims to find relationships between items in large datasets.</li>
</ul>

<h3 id="association-rule">Association Rule</h3>

<ul>
  <li>Association rules find interesting relations between variables in large databases.</li>
  <li>They identify strong rules based on measures of interestingness.</li>
  <li>Example: “If a customer buys a coffee, they are 80% likely to also purchase a muffin.”</li>
</ul>

<h3 id="market-basket-analysis">Market Basket Analysis</h3>

<ul>
  <li>Modelling technique that explores item associations in shopping baskets.</li>
  <li>Used by retailers to uncover item relationships.</li>
  <li>Analyzes frequent co-occurrences of items in transactions.</li>
  <li>Example: Customers buying computers often purchase antivirus software, suggesting strategic product placement.</li>
</ul>

<h3 id="name-applications-of-frequent-pattern-mining">Name Applications of Frequent Pattern Mining</h3>

<ul>
  <li><u>Data Preprocessing and Noise Filtering</u>:
    <ul>
      <li>Helps filter out noise and clean data.</li>
      <li>Distinguishes frequent item co-occurrences from random noise.</li>
    </ul>
  </li>
  <li><u>Discovery of Inherent Structures and Clusters</u>:
    <ul>
      <li>Reveals hidden structures and clusters in data.</li>
      <li>Identifies coauthor and conference clusters in DBLP data set.</li>
    </ul>
  </li>
  <li><u>Pattern-based Classification</u>:
    <ul>
      <li>Constructs reliable classification models using frequent patterns.</li>
      <li>Provides more information gain compared to infrequent patterns.</li>
    </ul>
  </li>
  <li><u>Subspace Clustering in High-Dimensional Space</u>:
    <ul>
      <li>Supports effective clustering in high-dimensional space.</li>
      <li>Overcomes challenges of measuring distances in such spaces.</li>
    </ul>
  </li>
  <li><u>Microarray Data Analysis</u>:
    <ul>
      <li>Analyzes noisy microarray data with thousands of dimensions.</li>
      <li>Helps differentiate noise from meaningful patterns.</li>
    </ul>
  </li>
  <li><u>Semantic Annotation of Frequent Patterns</u>:
    <ul>
      <li>Enhances understanding of frequent patterns with annotations.</li>
      <li>Provides additional context and meaning to the patterns.</li>
    </ul>
  </li>
</ul>

<h3 id="applications-of-market-basket-analysis">Applications of Market Basket Analysis</h3>

<ul>
  <li><u>Marketing and Advertising Strategies</u>:
    <ul>
      <li>Tailoring marketing efforts based on frequently bought together products.</li>
      <li>Optimizing advertising strategies using market basket analysis insights.</li>
    </ul>
  </li>
  <li><u>Store Layout Design</u>:
    <ul>
      <li>Placing frequently purchased items together in store layout.</li>
      <li>Utilizing strategic placement to maximize sales and customer experience.</li>
    </ul>
  </li>
  <li><u>Sales Planning</u>:
    <ul>
      <li>Identifying items to put on sale based on frequent associations.</li>
      <li>Promoting complementary items to boost sales.</li>
    </ul>
  </li>
  <li><u>Catalog Design</u>:
    <ul>
      <li>Grouping frequently bought together items in catalogs.</li>
      <li>Enhancing catalog layout for increased sales potential.</li>
    </ul>
  </li>
  <li><u>Cross-Marketing</u>:
    <ul>
      <li>Utilizing correlations to make effective cross-marketing decisions.</li>
      <li>Understanding product associations to drive sales across different categories.</li>
    </ul>
  </li>
  <li><u>Customer Shopping Behavior Analysis</u>:
    <ul>
      <li>Analyzing buying habits and preferences of customers.</li>
      <li>Improving shopping experience and increasing sales based on insights.</li>
    </ul>
  </li>
</ul>

<h3 id="frequent-itemset-mining-methods">Frequent Itemset Mining Methods</h3>

<ul>
  <li><strong>Apriori Algorithm</strong>:
    <ul>
      <li>Mines frequent itemsets for Boolean association rules.</li>
      <li>Uses the Apriori property and iterative approach.</li>
      <li>Forms candidate itemsets based on frequent (k-1)-itemsets.</li>
      <li>Scans the database to find complete sets of frequent itemsets.</li>
      <li>Variations include hashing, transaction reduction, partitioning, and sampling for efficiency improvement.</li>
    </ul>
  </li>
  <li><strong>Frequent Pattern Growth (FP-growth)</strong>:
    <ul>
      <li>Mines frequent itemsets without candidate generation.</li>
      <li>Constructs a compact FP-tree data structure.</li>
      <li>Compresses the transaction database.</li>
      <li>Focuses on frequent pattern growth rather than generate-and-test.</li>
      <li>Offers improved efficiency compared to Apriori-like methods.</li>
    </ul>
  </li>
</ul>

<h3 id="mining-association-rules">Mining Association Rules</h3>

<p>Mining association rules involves several steps:</p>

<ul>
  <li><strong>Finding Frequent Itemsets</strong>:
    <ul>
      <li>Identify itemsets (e.g., A and B) that meet a minimum support threshold.</li>
      <li>Support threshold ensures sufficient occurrence in the data.</li>
    </ul>
  </li>
  <li><strong>Generating Strong Association Rules</strong>:
    <ul>
      <li>Generate association rules (A -&gt; B) from frequent itemsets.</li>
      <li>Rules meet a minimum confidence threshold.</li>
      <li>Confidence indicates the probability of B given A.</li>
    </ul>
  </li>
  <li><strong>Uncovering Correlation Rules</strong>:
    <ul>
      <li>Analyze associations to uncover correlation rules.</li>
      <li>Reveal statistical correlations between itemsets A and B.</li>
    </ul>
  </li>
  <li><strong>Classifying Algorithms</strong>:
    <ul>
      <li>Efficient and scalable algorithms for mining frequent itemsets.</li>
      <li>Three categories: Apriori-like, FP-growth, and vertical data format.</li>
    </ul>
  </li>
  <li><strong>Evaluating Patterns</strong>:
    <ul>
      <li>Augment support-confidence framework with pattern evaluation.</li>
      <li>Evaluate interestingness of association rules.</li>
      <li>Consider null-invariant measures (unaffected by null-transactions).</li>
      <li>Common measures: lift, χ2, all confidence, max confidence, Kulczynski, cosine.</li>
    </ul>
  </li>
</ul>]]></content><author><name>Abhay Singh</name></author><category term="[&quot;bca&quot;]" /><category term="bca" /><category term="mining" /><category term="data mining" /><category term="data warehouse" /></entry><entry><title type="html">Semester 3 - Data Structure &amp;amp; Algorithm</title><link href="https://imabhay.com/posts/bca/s3-dsa-imp2/" rel="alternate" type="text/html" title="Semester 3 - Data Structure &amp;amp; Algorithm" /><published>2023-05-19T00:00:00+00:00</published><updated>2023-05-19T00:00:00+00:00</updated><id>https://imabhay.com/posts/bca/s3-dsa-imp2</id><content type="html" xml:base="https://imabhay.com/posts/bca/s3-dsa-imp2/"><![CDATA[<h2 id="trees">Trees</h2>
<ul>
  <li>Trees are hierarchical structures with a root node and connected nodes without cycles.</li>
  <li>Each node has a parent (except root) and children.</li>
  <li>Leaf nodes have no children.</li>
  <li>Depth: number of edges from root to node</li>
  <li>Height: number of edges from node to deepest leaf.</li>
  <li>Trees have various applications:
    <ul>
      <li>File system in OS</li>
      <li>B-Tree, B+-Tree for indexing in databases</li>
      <li>Syntax Tree in compilers</li>
      <li>Document Object Model (DOM)</li>
    </ul>
  </li>
</ul>

<h3 id="binary-trees">Binary Trees</h3>
<ul>
  <li>Binary trees are trees where each node has up to two children: left and right.</li>
  <li>Types include:
    <ul>
      <li>Full: Nodes have 0 or 2 children.</li>
      <li>Perfect: All nodes have two children, leaves are at the same level.</li>
      <li>Complete: All levels are fully filled except possibly the last.</li>
      <li>Balanced: Left and right subtrees’ heights differ by at most one.</li>
      <li>Degenerate: Each node has only one child, similar to a linked list.</li>
    </ul>
  </li>
</ul>

<p><img src="https://upload.wikimedia.org/wikipedia/commons/f/f6/Sorted_binary_tree.png" alt="image-center" class="align-center" width="400" /></p>

<p style="color:gray; font-size: 80%; text-align: center;">Binart Tree</p>

<h3 id="binary-search-trees-bst">Binary Search Trees (BST)</h3>
<ul>
  <li>BST is a binary tree where each node’s left children are less than the node and right children are greater.</li>
  <li>Operations:
    <ul>
      <li>Search: Traverse from root to left/right subtree based on comparison until value is found or subtree is null.</li>
      <li>Insertion: Like search, but create a new node at null subtree.</li>
      <li>Deletion: Remove node and maintain BST property. Consider cases: no child, one child, two children.</li>
    </ul>
  </li>
</ul>

<p><img src="https://upload.wikimedia.org/wikipedia/commons/8/83/Binary-search-tree-insertion-animation.gif" alt="image-center" class="align-center" width="400" /></p>

<p style="color:gray; font-size: 80%; text-align: center;">BST - Insert Operation</p>

<h3 id="avl-trees">AVL Trees</h3>
<ul>
  <li>Named after inventors Adelson-Velsky and Landis</li>
  <li>Self-balancing binary search trees.</li>
  <li>Heights of two child subtrees of any node differ by at most one.</li>
  <li>Rebalancing is done through rotations if heights differ by more than one.</li>
  <li>Offer faster retrievals but slower insertions and deletions compared to some other trees.</li>
  <li>Used in applications where fast retrievals are crucial.</li>
</ul>

<p><strong>Balance Factor</strong></p>

<ul>
  <li>Balance factor (k) = height of left sub-tree - height of right sub-tree.</li>
  <li>Balance factor 1: left sub-tree is one level higher.</li>
  <li>Balance factor 0: both sub-trees are of equal height.</li>
  <li>Balance factor -1: right sub-tree is one level higher.</li>
  <li>An AVL tree has balance factors within the range -1 to +1.</li>
</ul>

<p><strong>AVL Trees Rotations</strong></p>
<ul>
  <li>AVL Tree Rotations: Performed to maintain balance during insertions/deletions.</li>
  <li>Four types: Left-Left, Right-Right, Left-Right, Right-Left.</li>
  <li>Left-Left (LL): Single right rotation.</li>
  <li>Right-Right (RR): Single left rotation.</li>
  <li>Left-Right (LR): Double rotation; first left, then right.</li>
  <li>Right-Left (RL): Double rotation; first right, then left.</li>
  <li>Rotations restore balance without affecting order properties.</li>
</ul>

<p><img src="https://upload.wikimedia.org/wikipedia/commons/f/fd/AVL_Tree_Example.gif" alt="image-center" class="align-center" width="400" /></p>

<p style="color:gray; font-size: 80%; text-align: center;">AVL Trees - Rotations Animation</p>

<p style="color:gray; font-size: 80%; text-align: center;"><img src="https://upload.wikimedia.org/wikipedia/commons/c/c4/Tree_Rebalancing.gif" alt="image-center" class="align-center" width="1000" />
AVL Trees - Rotations</p>

<h3 id="tree-traversal">Tree traversal</h3>
<ul>
  <li>Process of visiting each node in a tree once.</li>
  <li>Can be depth-first (In-order, Pre-order, Post-order) or breadth-first.</li>
  <li>There are three common ways to traverse a tree in depth-first order:
    <ul>
      <li>In-order (Left, Root, Right)</li>
      <li>Pre-order (Root, Left, Right)</li>
      <li>Post-order (Left, Right, Root)</li>
    </ul>
  </li>
</ul>

<p><img src="https://upload.wikimedia.org/wikipedia/commons/0/06/InorderTrav.gif" alt="image-center" class="align-center" width="300" /></p>

<p style="color:gray; font-size: 80%; text-align: center;">In-order Traversal</p>

<p><img src="https://upload.wikimedia.org/wikipedia/commons/1/19/PreOrderTrav.gif" alt="image-center" class="align-center" width="300" /></p>

<p style="color:gray; font-size: 80%; text-align: center;">Pre-order Traversal</p>

<p><img src="https://upload.wikimedia.org/wikipedia/commons/9/99/PostorderTrav.gif" alt="image-center" class="align-center" width="300" /></p>

<p style="color:gray; font-size: 80%; text-align: center;">Post-order Traversal</p>

<p><br /></p>]]></content><author><name>Abhay Singh</name></author><category term="[&quot;bca&quot;]" /><category term="bca" /><category term="dsa" /><category term="algorithm" /><category term="data structure" /><category term="java" /><summary type="html"><![CDATA[Collection of lecture notes, flashcards, tools, tutorials, and other references.]]></summary></entry><entry><title type="html">Semester 3 - DSA - Mock(Theory)</title><link href="https://imabhay.com/posts/bca/s3-dsa-mock-theory/" rel="alternate" type="text/html" title="Semester 3 - DSA - Mock(Theory)" /><published>2023-05-19T00:00:00+00:00</published><updated>2023-05-19T00:00:00+00:00</updated><id>https://imabhay.com/posts/bca/s3-dsa-mock-theory</id><content type="html" xml:base="https://imabhay.com/posts/bca/s3-dsa-mock-theory/"><![CDATA[<p><br /></p>

<p><strong>Q1. The rate of growth or order of growth of a function f(n), means how fast the function increases its value as
the input size n increases. List and explain various notations used to express orders of growth.</strong></p>

<p><u>Answer:</u></p>

<ul>
  <li><strong>Big O Notation (O)</strong>: Describes the upper bound on the time complexity of an algorithm. Represents the maximum time taken for all input sizes.
    <ul>
      <li>O(1) is constant time complexity. (Best)</li>
      <li>O(log n) is logarithmic time complexity. (Good)</li>
      <li>O(n) is linear time complexity. (Fair)</li>
      <li>O(n log n) is linearithmic time complexity. (Not ideal)</li>
      <li>O(n^2) is quadratic time complexity. (Worse)</li>
      <li>O(n^3) is cubic time complexity. (Worse)</li>
      <li>O(2^n) is exponential time complexity. (Worst)</li>
    </ul>
  </li>
  <li>
    <p><strong>Big Omega Notation (Ω)</strong>: Provides the asymptotic lower bound, representing the minimum time taken by an algorithm for all input sizes.</p>
  </li>
  <li>
    <p><strong>Big Theta Notation (Θ)</strong>: Gives a tight bound on the time complexity, representing both the best-case and worst-case scenarios.</p>
  </li>
  <li>
    <p><strong>Little o Notation (o)</strong>: Provides an upper bound that is not tight, indicating that the actual time complexity is less than the one specified.</p>
  </li>
  <li><strong>Little Omega Notation (ω)</strong>: Provides a lower bound that is not tight, indicating that the actual time complexity is more than the one specified.</li>
</ul>

<p>These notations help analyze and compare the efficiency of algorithms based on their growth with input size.</p>

<p><strong>Q2. Recursive functions are executed in a Last In First Out-order. Name a suitable data structure for implementing recursive calls and mention any two operations of that data structure.</strong></p>

<p><u>Answer:</u></p>
<ul>
  <li>The suitable data structure for implementing recursive calls is the <strong>Stack</strong>.</li>
  <li>The two primary operations associated with a stack are:
    <ul>
      <li><strong>Push</strong>: This operation adds an element to the top of the stack.</li>
      <li><strong>Pop</strong>: This operation removes an element from the top of the stack.</li>
    </ul>
  </li>
</ul>

<p>Stacks follow a Last-In-First-Out (LIFO) principle, which aligns with the execution order of recursive functions. When a function calls itself recursively, the call information is “pushed” onto the stack, and when the function returns, the information is “popped” off. This ensures the correct order of execution for nested recursive calls.</p>

<p><strong>Q3. Name any three algorithm design techniques</strong></p>

<p><u>Answer:</u></p>

<p><strong><u>Five common algorithm design techniques:</u></strong></p>

<ol>
  <li>
    <p><strong>Divide and Conquer</strong>: This technique involves breaking down a problem into smaller subproblems, solving each subproblem independently, and then combining the solutions to solve the original problem.</p>
  </li>
  <li>
    <p><strong>Dynamic Programming</strong>: This technique is used when the subproblems overlap. It involves solving each subproblem only once and then storing the results of each subproblem to avoid duplicate work.</p>
  </li>
  <li>
    <p><strong>Greedy Algorithms</strong>: This technique involves making the locally optimal choice at each stage with the hope that these local choices will lead to a global optimum.</p>
  </li>
  <li>
    <p><strong>Backtracking</strong>: This technique is used for solving problems where the solution requires the sequence of decisions. If the sequence of decisions made so far has not led to a solution, then the algorithm goes back and tries the next decision.</p>
  </li>
  <li>
    <p><strong>Brute Force</strong>: This technique involves trying all possible solutions until a satisfactory solution is found. It is simple to implement but may not be efficient for complex problems.</p>
  </li>
</ol>

<p><strong>Q4. Identify the correct way to declare a multidimenstional array in java.</strong></p>

<p><u>Answer:</u></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dataType[][] arrayName;
int[][] arr;
or
int arr[][];
</code></pre></div></div>

<p><strong>Q5. The Pre-order traversal in a tree can also be known as</strong></p>

<ul>
  <li>Depth first</li>
  <li>Breadth first</li>
  <li>Topological order</li>
  <li>Linear order</li>
</ul>

<p><u>Answer:</u></p>

<ul>
  <li>Depth first</li>
</ul>

<p>Pre-order traversal is a type of depth-first traversal. In a pre-order traversal of a tree, the process is as follows: visit the root node, traverse the left subtree, then traverse the right subtree.</p>

<p><strong>Q6. Which algorithm design techniques is applied in Merge sort?</strong></p>

<ul>
  <li>Divide and conquer</li>
  <li>Greedy Approch</li>
  <li>Backtracking</li>
  <li>Dynamic Programming</li>
</ul>

<p><u>Answer:</u></p>
<ul>
  <li>Divide and conquer</li>
</ul>

<p>Merge sort is a classic example of the divide and conquer algorithm design technique. The algorithm recursively divides the array into two halves, sorts them, and then merges the sorted halves.</p>

<p><strong>Q7. What’s the most appropriate data structure to implement a priority queue?</strong></p>

<ul>
  <li>Heap</li>
  <li>Circular Array</li>
  <li>Linked List</li>
  <li>Binary Trees</li>
</ul>

<p><u>Answer:</u></p>

<ul>
  <li>Heap</li>
</ul>

<p>A heap is the most appropriate data structure to implement a priority queue. It allows for efficient insertion of new elements and removal of the element with the highest priority, both operations being O(log n) in complexity. This is more efficient than using a sorted array, unsorted array, or other data structures like linked lists or binary trees for this purpose.</p>

<p><strong>Q8. Which of the following data structure is linear type?</strong></p>

<ul>
  <li>String</li>
  <li>List</li>
  <li>Queue</li>
  <li>All of this</li>
</ul>

<p><u>Answer:</u></p>
<ul>
  <li>All of this</li>
  <li>String is datatype but also an array of characters</li>
</ul>

<p><br /></p>]]></content><author><name>Abhay Singh</name></author><category term="[&quot;bca&quot;]" /><category term="bca" /><category term="dsa" /><category term="algorithm" /><category term="data structure" /><category term="java" /></entry><entry><title type="html">Semester 3 - DSA - Sample Test</title><link href="https://imabhay.com/posts/bca/s3-dsa-sample-test-ans/" rel="alternate" type="text/html" title="Semester 3 - DSA - Sample Test" /><published>2023-05-19T00:00:00+00:00</published><updated>2023-05-19T00:00:00+00:00</updated><id>https://imabhay.com/posts/bca/s3-dsa-sample-test-ans</id><content type="html" xml:base="https://imabhay.com/posts/bca/s3-dsa-sample-test-ans/"><![CDATA[<p><br /></p>

<p>Q1. The postfix form a given string S = ABC+-T<em>, then the find out the S.<br />
   A) (A-(B+C))</em>T<br />
   B) A+B-C<em>T<br />
   C) A</em>B-C+T<br />
   D) A*B+C-T<br />
   <code class="language-plaintext highlighter-rouge">Answer: A) (A-(B+C))*T</code></p>

<p><u>Explanation:</u></p>

<p><img src="/assets/images/bca/s3-dsa/s3-dsa-s1.jpg" alt="image-center" class="align-center" width="500" /></p>

<p>Q2. H is a graph with k vertices. H is connected and has exactly k-1 edges, then:<br />
   A) H is a tree<br />
   B) H contains no cycles<br />
   C) Every pair of vertices in G is connected by exactly one path<br />
   D) All of these  <br />
  <code class="language-plaintext highlighter-rouge">Answer: D) All of these</code></p>

<p><u>Explanation:</u> Formula to calculate no. of edges ‘E’ if number of Nodes/vertices is ‘K’ is E = K-1</p>

<p>Q3. Initially a queue with configuration is p, q, r, s. ‘p’ is at the front. To get the configuration s, r, q, p find the number of deletions and additions are? required<br />
   A) 4 deletions, 4 additions<br />
   B) 3 deletions, 3 additions<br />
   C) 5 deletions, 5 additions<br />
   D) 2 deletions, 2 additions <br />
   <code class="language-plaintext highlighter-rouge">Answer: A) 3 deletions, 3 additions</code></p>

<p><u>Explanation:</u> remove p,q,r and insert r, q, p in order.</p>

<p>Q4. The traversal technique which lists the nodes of a binary search tree in ascending order?<br />
   A) post-order<br />
   B) in-order<br />
   C) pre-order<br />
   D) linear order<br />
   <code class="language-plaintext highlighter-rouge">Answer: B) in-order</code></p>

<p><u>Explanation:</u></p>
<ul>
  <li>In-order (Left, Root, Right) —&gt; Ascending order (left is smaller than root, right is greater than root)</li>
  <li>Pre-order (Root, Left, Right)</li>
  <li>Post-order (Left, Right, Root)</li>
</ul>

<p>Q5. Given a binary tree whose in order and preorder traversal are given below:<br />
   Preorder: BCQIPDNHML<br />
   In order: QICPBNDMHL<br />
   The post order traversal of the above binary tree is:<br />
   A) QICPNHDMLB<br />
   B) QICPHNDMLB<br />
   C) QICPNHDMBL<br />
   D) IPQCNMLHDB  <br />
  <code class="language-plaintext highlighter-rouge">Answer: D) IPQCNMLHDB</code></p>

<p><u>Explanation:</u>  <a href="https://testbook.com/objective-questions/mcq-on-tree-traversal--5eea6a1139140f30f369eb98">See Question 2 Here</a></p>

<p>In our case, B is root, and graph would be</p>

<p><img src="/assets/images/bca/s3-dsa/s3-dsa-trav1.png" alt="image-center" class="align-center" width="500" /></p>

<p>Q6. The postfix expression AB+CD–* can be evaluated using a<br />
   A) Stack<br />
   B) Tree<br />
   C) Queue<br />
   D) Linked list  <br />
   <code class="language-plaintext highlighter-rouge">Answer: A) Stack</code></p>

<p><u>Explanation:</u></p>
<ul>
  <li>Push ‘A’, ‘B’ into stack</li>
  <li>Pop ‘A’, ‘B’ and perform ‘+’ operation</li>
  <li>Push ‘A+B’ into stack, Push ‘c’ &amp; ‘D’ into stack</li>
  <li>Pop ‘C’ &amp; ‘D’ and perform ‘-‘ operation</li>
  <li>Push ‘C-D’ into stack</li>
  <li>pop ‘A+B’ and ‘C-D’ from stack and perform ‘*’</li>
  <li>push ‘(A+B)*(C-D)’ into the stack</li>
</ul>

<p>Q7. A binary search tree is a binary tree:<br />
   A) All items in the left sub-tree are less than root<br />
   B) All items in the right sub-tree are greater than or equal to the root<br />
   C) Each sub-tree is itself a binary search tree<br />
   D) All of the above  <br />
   <code class="language-plaintext highlighter-rouge">Answer: D) All of the above</code></p>

<p><u>Explanation:</u> order is left side &lt; root &lt; right side</p>

<p>Q8. The In-order traversal of the tree will yield a sorted listing of elements of tree in<br />
   A) Binary tree<br />
   B) Binary search tree<br />
   C) Heaps<br />
   D) None of the above  <br />
   <code class="language-plaintext highlighter-rouge">Answer: B) Binary search tree</code></p>

<p><u>Explanation:</u> In a binary search tree, the left subtree of a node contains values smaller than the node, and the right subtree contains values greater than the node</p>

<p>Q9. How many binary trees formed with 5 nodes is<br />
   A) 22<br />
   B) 46<br />
   C) 120<br />
   D) 42  <br />
   <code class="language-plaintext highlighter-rouge">Answer: D) 42</code></p>

<p><u>Explanation:</u> Formula is <strong>2n!/(n+1)!n!</strong><br />
   The number of binary trees for 1 to 10 nodes should be 1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796</p>

<p>Q10. The following postfix expression is evaluated using a stack 823^/52* + 41* – The top two elements of the stack after first * is evaluated<br />
    A) 8, 10<br />
    B) 4, 25 
    C) 2, 25<br />
    D) 1, 10 <br />
    <code class="language-plaintext highlighter-rouge">Answer: D) 1, 10</code><br />
    <u>Explanation:</u></p>

<p>Step 1: Push 8, 2, and 3 onto the stack.<br />
Stack: [8, 2, 3]</p>

<p>Step 2: Pop 3 and 2 from the stack, evaluate 2^3 = 8, and push the result (8) onto the stack.<br />
Stack: [8, 8]</p>

<p>Step 3: Pop 8 and 8 from the stack, evaluate 8 / 8 = 1, and push the result (1) onto the stack.<br />
Stack: [1]</p>

<p>Step 4: Encounter ‘5’, push it onto the stack.<br />
Stack: [1, 5]</p>

<p>Step 5: Encounter ‘2’, push it onto the stack.<br />
Stack: [1, 5, 2]</p>

<p>Step 6: Pop 2 and 5 from the stack, evaluate 5 * 2 = 10, and push the result (10) onto the stack.<br />
Stack: [1, 10]</p>

<p>Q11. The operations where the worst case time complexity of AVL tree is better while comparing with binary search tree for<br />
    A) Search, Delete and Insert Operations<br />
    B) Search and Delete Operations<br />
    C) Insert and Delete Operations<br />
    D) Search, and Insert Operations  <br />
    <code class="language-plaintext highlighter-rouge">Answer: A) Search, Delete and Insert Operations</code></p>

<p>Q12. Suppose an empty stack performing operations in the given order: push(1), push(2), Pop, push(3), push(4), push(5), Pop, what is the top of the stack?<br />
    A) 1<br />
    B) 2<br />
    C) 3<br />
    D) 4  <br />
    <code class="language-plaintext highlighter-rouge">Answer: D) 4</code></p>

<p>Q13. What is the minimum number of nodes in a binary tree of depth k (root is at level 0).<br />
    A) 2 k – 1<br />
    B) 2 k+1 – 1<br />
    C) k + 1<br />
    D) k  <br />
    <code class="language-plaintext highlighter-rouge">Answer: C) k + 1</code><br />
    <u>Explanation:</u> Assuming one node at each level, minimum number of nodes with depth/level k is <strong>K+1</strong>
     And the maximum number of nodes with depth/level k is 1 + 2 + 4 + …+ 2<sup>k</sup> = <strong>2<sup>k+1</sup> - 1</strong></p>

<p>Q14. Which is the efficient data structure to insert or delete a number in a stored set of numbers is<br />
    A) Binary tree<br />
    B) Linked list<br />
    C) Doubly linked list<br />
    D) Queue  <br />
    <code class="language-plaintext highlighter-rouge">Answer: C) Doubly linked list</code></p>

<p>Q15. Suppose a queue is implemented with a linked list, and keeping track of a front pointer and a rear pointer, during an insertion into a non-empty queue which these pointers are changed?<br />
    A) Only rear pointer changes<br />
    B) Only front pointer changes<br />
    C) Neither of the pointers change<br />
    D) Both of the pointers changes  <br />
    <code class="language-plaintext highlighter-rouge">Answer: A) Only rear pointer changes</code></p>

<p>Q16. In linked list implementation of a queue, front and rear pointers are tracked. Which of these pointers will change during an insertion into an EMPTY queue?<br />
    a) Only front pointer<br />
    b) Only rear pointer<br />
    c) Both front and rear pointers<br />
    d) No pointer will be changed  <br />
    <code class="language-plaintext highlighter-rouge">Answer: c) Both front and rear pointers</code></p>

<p>Q17. What is the maximum number of parentheses that will appear on the stack at any one time for a parenthesis expression given by ( () (()) (()) ) ))<br />
    A) 2<br />
    B) 3<br />
    C) 4<br />
    D) 5  <br />
    <code class="language-plaintext highlighter-rouge">Answer: B) 3</code><br />
    <u>Explanation:</u></p>

<ul>
  <li>Push “(“ onto the stack: [ ( ]</li>
  <li>Push “(“ onto the stack: [ (, ( ]</li>
  <li>Match “)” with the top of the stack: [ ( ]</li>
  <li>Push “(“ onto the stack: [ (, ( ]</li>
  <li>Push “(“ onto the stack: [ (, (, ( ]</li>
  <li>Match “)” with the top of the stack: [ (, ( ]</li>
  <li>Match “)” with the top of the stack: [ ( ]</li>
  <li>Match “)” with the top of the stack: [ ]</li>
</ul>

<p>At any point during the evaluation, the maximum number of parentheses on the stack is 3.</p>

<p><br /></p>]]></content><author><name>Abhay Singh</name></author><category term="[&quot;bca&quot;]" /><category term="bca" /><category term="dsa" /><category term="algorithm" /><category term="data structure" /><category term="java" /></entry></feed>