General Instructions
General Instructions
This assignment must be completed manually in the student's notebook/assignment sheets.
Do not use ChatGPT, Gemini, Copilot, Perplexity, Google Search, or any other AI/search tool.
Do not copy solutions from books, websites, classmates, or online sources.
Write all algorithms, flowcharts, programs, calculations, and dry runs by hand.
Use C++ for programming questions.
For every algorithmic problem, follow this sequence: Problem Understanding → Algorithm → Flowchart → Program → Dry Run/Trace → Result → Real-World Application
7. Students may use only the concepts explained during classroom/laboratory sessions.
8. The teacher may ask students to explain or reproduce any submitted solution orally.
Conceptual Understanding
Answer the following in your own words:
What is a data element? Give one example.
What is a data structure? Explain its purpose.
What is a variable? Give one programming example.
What is a constant? Give one programming example.
What is an array? Explain why an array is called a linear data structure.
Write three differences between a variable and a constant.
Explain the difference between a data type and a data structure.
Give four examples of data types and four examples of data structures.
Explain the meaning of base address.
Explain row-major and column-major storage.
Memory Address Calculation
Assignment 2: One-Dimensional Array
An integer array A[20] has:
Base Address = 1000
Element size = 4 bytes
Indexing starts from 0
Calculate the memory address of:
A[3]
A[7]
A[12]
A[19]
Show the formula and complete calculation for every answer.
Assignment 3: One-Dimensional Array with 1-Based Indexing
An array\ LIST[30] has:
Address of LIST[1] = 500
Element size = 2 bytes
Indexing starts from 1
Calculate the address of:
LIST[5]
LIST[12]
LIST[20]
LIST[29]
Assignment 4: Row-Major Address Calculation
Consider:MAT[8][6]
Given:
Base Address = 500
Element size = 4 bytes
Indexing starts from 1
Storage = Row-Major
Calculate the address of:
MAT[2][3]
MAT[5][4]
MAT[7][6]
Write the general formula first, followed by the calculation.
Assignment 5: Row-Major vs. Column-Major
Consider:n TAB[8][8]
Given:
Base Address = 100
Element size = 4 bytes
Indexing starts from 1
Find the address of TAB[7][4] using:
Row-Major Order
Column-Major Order
Finally, explain why the two addresses are different.
Memory Address Calculation
Part C — Algorithm and Flowchart
____________________________________________________________
For each problem below, students must not start with the program.
First write: Problem → Algorithm → Flowchart → Program
Assignment 6: Find Maximum and Its Occurrence
Given the array: LIST = [12, 45, 8, 45, 23, 45, 17]
Develop a solution to:
Find the maximum element.
Count how many times the maximum element occurs.
Submit:
Algorithm
Flowchart
C++ program
Dry-run table
Final output
One practical application
Assignment 7: Reverse an Array
Given: DATA = [10, 20, 30, 40, 50, 60]
Develop an algorithm to reverse the array without using another array.
Submit:
Algorithm
Flowchart
C++ program
Dry-run showing left and right
Final array
Time complexity
One practical application
Assignment 8: Search an Element
Given: A = [15, 8, 23, 42, 16, 8, 31, 50]
Write an algorithm to search for a value entered by the user.
Test the algorithm manually for:
Search for 42
Search for 8
Search for 100
For each case, show:
Algorithm
Flowchart
Program
Dry run
Whether the element was found
Position/index of the element
Array Modification Problems
Assignment 9: Insert an Element
Given:
A = [10, 20, 30, 40, 50]
Insert 25 at position 3.
Students must:
Show the original array.
Show every shifting operation.
Write the algorithm.
Draw the flowchart.
Write the C++ program.
Show the final array.
Assignment 10: Delete an Element
Given:
A = [10, 20, 30, 40, 50, 60]
Delete the element at position 4.
Show:
Original array
Each shifting operation
Algorithm
Flowchart
C++ program
Final array
Merging Sorted Arrays
Assignment 11: Merge Two Sorted Arrays
Given:
A = [2, 8, 15, 21]
B = [3, 7, 18, 25]
Merge them into a third array C.
Submit:
Algorithm
Flowchart
C++ program
Complete dry-run table showing i, j, k, and C
Final merged array
Time complexity
One real-world application
Some Sorting Algorithms
Assignment 12: Selection Sort
Sort the following array using Selection Sort: [25, 8, 25, 28, 16, 35, 8, 85, 90, 92, 37]
Students must manually show:
Initial array
Minimum element selected in every pass
Minimum index
Swap performed
Array after every pass
Final sorted array
Then write:
Algorithm
Flowchart
C++ program
Time complexity
Space complexity
One practical application
Assignment 13: Bubble Sort
Sort the following array using Bubble Sort: [25, 8, 25, 28, 16, 35, 8, 85, 90, 92, 37]
Show the array after every complete pass.
Also record:
Number of comparisons
Number of swaps
Pass in which the array becomes sorted
Then write:
Algorithm
Flowchart
C++ program
Time complexity
Real-world/educational application
Assignment 14: Insertion Sort
Sort the following array using Insertion Sort: [25, 28, 16, 35, 85, 8, 90, 92, 37]
For every pass, show:
i
key
Value of j
Elements shifted
Array after insertion
Then write:
Algorithm
Flowchart
C++ program
Time complexity
Real-world application
Comparative Manual Analysis
Assignment 15: Compare Sorting Algorithms
Using the same array: [29, 10, 14, 37, 13, 8]
Perform the sorting manually using:
Selection Sort
Bubble Sort
Insertion Sort
Prepare a comparison table containing:
________________________________________________________________________________________________
Parameter Selection Sort Bubble Sort Insertion Sort
________________________________________________________________________________________________
Number of passes
Number of comparisons
Number of swaps/shifts
Best-case complexity
Worst-case complexity
Suitable situation
________________________________________________________________________________________________
No online reference may be used for completing the table.
Integrated Problem-Solving Assignment
Assignment 16: Complete 5-Step Challenge
Given: MARKS = [72, 45, 89, 67, 89, 34, 91, 56, 91, 78]
Develop a complete solution to:
Find the highest mark.
Count the number of students obtaining the highest mark.
Find the position of the highest mark.
Sort the marks in ascending order.
For the solution, submit:
Step 1: Algorithm
Step 2: Flowchart
Step 3: C++ Program
Step 4: Complete Dry Run
Step 5: Real-World Application
Assignement: Solution Video based Verification
For the above problem statements : Prepare detailed videos to perform these tasks, demonstrating your DSA Skills seeing for this assignment, such as:
Explain the algorithm.
Draw the flowchart on the board.
Perform one dry run.
Calculate an array address.
Explain one line of their program.
Modify the input and predict the output.
Correct an intentionally introduced error.
Explain the time complexity.
Important
The submitted assignment is considered complete only when the student can explain the solution independently.
ViVA : The objective of this assignment is to assess individual logical thinking and manual problem-solving ability. Students are therefore required to complete the work independently using classroom learning. Use of LLMs, AI coding assistants, Google Search, online solution websites, or copied solutions is not permitted.
A. Data, Information, Knowledge and Wisdom
What is data?
Give three examples of data.
What is the difference between data and information?
When does data become information?
What is knowledge?
How is knowledge different from information?
What is wisdom?
Explain the sequence: Data → Information → Knowledge → Wisdom.
Give a real-life example of Data → Information → Knowledge → Wisdom.
What is the role of context in converting data into information?
What is the role of relationships in knowledge formation?
What is the role of rules in knowledge processing?
What is the difference between knowledge and inference?
Give an example where the same data can produce different information because of context.
Can information exist without data? Explain.
Can knowledge be generated from information without rules or interpretation?
What is the difference between processing and interpretation?
What is meant by decision-making in the context of wisdom?
In the sentence "Ravi scored 85 marks in Data Structures," identify the data.
What is the information contained in this sentence?
What additional rule would be required to conclude that Ravi performed well?
What is the knowledge obtained from the sentence?
What inference could be made from this knowledge?
Which NLP operations belong to data processing?
What is tokenization?
What is normalization?
What is stemming?
What is the difference between extracting information and understanding meaning?
Why is semantic analysis associated with knowledge processing?
B. Data Processing
What is data processing?
Why do we process raw data?
What is data collection?
What is data validation?
What is data cleaning?
Why is sorting considered a data-processing operation?
Why is searching considered data processing?
What is filtering?
What is aggregation?
Give an example of data processing using student marks.
If the marks are 45, 67, 89, 72, 55, what is the result after sorting?
What is the difference between sorting and classification?
What is the difference between calculation and aggregation?
C. Information Processing
What is information processing?
How is information processing different from data processing?
Why is context important in information processing?
What is summarization?
What is comparison?
What is correlation?
What is pattern identification?
Why is visualization useful for information processing?
If the student average is 65.6 and the class average is 58, what information can be derived?
Is sorting alone sufficient to generate meaningful information? Why?
D. Knowledge Processing
What is knowledge processing?
What is knowledge representation?
What is a knowledge rule?
What is inference?
What is logical reasoning?
What is the difference between classification and inference?
What is prediction?
What is recommendation?
Consider:
IF student average > class average
THEN performance = Above Average
What type of knowledge representation is this?
If the student average is 65.6 and the class average is 58, what inference will be obtained?
What would happen if the student average were 50?
Why are rules important in knowledge processing?
How is knowledge processing related to expert systems?
E. Data Types
What is a data type?
Why do programming languages require data types?
What information does a data type provide?
What is a primitive data type?
Name the primitive data types commonly used in C.
What is the purpose of int?
What is the purpose of char?
What is the difference between float and double?
What is the purpose of bool?
What is void?
Why does a character occupy different conceptual meaning from an integer even though both may use binary representation?
What is the difference between signed and unsigned data?
What is the advantage of using unsigned int?
What is the difference between short and long?
Why can the exact size of some C data types vary between implementations?
Which data type would you choose for:
Student roll number?
Student percentage?
Grade?
True/false result?
Why would you use double instead of float?
F. Non-Primitive and User-Defined Data Types
What is a non-primitive data type?
Why are non-primitive types required?
What is an array?
What is a structure?
What is a union?
What is a pointer?
What is a string in C?
What is the purpose of the null character '\0'?
What is the difference between a structure and a union?
Why can a union save memory?
What is a user-defined data type?
What is typedef?
What is an enum?
Why would you use a structure to represent a student?
In a structure containing rollNo, name, and marks, why are different data types required?
G. Data Types and Semantic Analysis
What is semantic analysis?
What is the role of data types in semantic analysis?
What is type checking?
What is type compatibility?
Consider:
int x;
float y;
x = y;
What issue should semantic analysis examine?
What is the difference between syntax error and semantic error?
Why should an operator be compatible with its operands?
Why does a compiler need to know the type of an expression?
How are data types related to symbol tables?
Why are function parameter types checked during semantic analysis?
Give an example of a semantically invalid operation.
H. Data Structures – Fundamentals
What is a data structure?
Why do we need data structures?
What are the three major components of a data structure?
What are data values?
What are relationships among data elements?
What are operations on a data structure?
Explain the statement:
Algorithms + Data Structures = Programs
What is an Abstract Data Type (ADT)?
How is an ADT different from a data structure?
What is meant by the physical implementation of an ADT?
Why is choosing an appropriate data structure important?
I. Operations on Data Structures
What is traversal?
What is searching?
What is insertion?
What is deletion?
What is updating?
What is sorting?
What is merging?
What is the difference between searching and traversal?
Why can insertion be expensive in an array?
Why can deletion be expensive in an array?
Give a real-world example of traversal.
Give a real-world example of insertion.
Give a real-world example of deletion.
Give a real-world example of merging two data structures.
J. Types of Data Structures
What is a primitive data structure?
What is a non-primitive data structure?
What is a linear data structure?
What is a non-linear data structure?
What is a static data structure?
What is a dynamic data structure?
Give examples of linear data structures.
Give examples of non-linear data structures.
Why is an array considered linear?
Why is a tree considered non-linear?
Why is a linked list considered dynamic?
Can an array be dynamic? Explain.
What is the difference between contiguous and non-contiguous memory?
Which data structures commonly use pointers?
K. Array
What is an array?
Why are array elements stored contiguously?
What is an index?
What is the base address of an array?
Why can array elements be accessed directly using an index?
What is the main limitation of a static array?
What happens when an element is inserted in the middle of an array?
What happens when an element is deleted from the middle of an array?
What is row-major order?
What is column-major order?
Why are row-major and column-major addresses different?
How would you calculate the address of a one-dimensional array element?
How would you calculate the address of a two-dimensional array element?
L. Stack
What is a stack?
What is the LIFO principle?
Give a real-world example of a stack.
What is the TOP of a stack?
What is push?
What is pop?
What is peek?
What is stack overflow?
What is stack underflow?
What is the purpose of isEmpty()?
What is the purpose of isFull()?
What happens to TOP after a push?
What happens to TOP after a pop?
Can insertion occur at the bottom of a stack?
Why is a stack useful for function calls?
How is a stack used in expression evaluation?
How is a stack used in undo operations?
Manual Stack Trace
Start with an empty stack and perform: Push(10), Push(20), Push(30), Pop(), Push(40), Peek()
What is the final stack and TOP?
What happens if you perform Pop() on an empty stack?
What happens if you perform Push() when an array-based stack is full?
M. Expression Evaluation Using Stack
What is an infix expression?
What is a prefix expression?
What is a postfix expression?
What is another name for prefix notation?
What is another name for postfix notation?
Why is postfix expression evaluation convenient using a stack?
Convert manually:
A + B
into postfix.
Convert:
A + B * C
into postfix.
Convert:
(A + B) * C
into postfix.
Evaluate the postfix expression: 5 3 + 2 *
While evaluating postfix, when is an operand pushed?
When an operator is encountered in postfix evaluation, what happens?
Why are two operands required for a binary operator?
N. Queue
What is a queue?
What is FIFO?
Give a real-world example of a queue.
What is the FRONT?
What is the REAR?
What is enqueue?
What is dequeue?
What is queue overflow?
What is queue underflow?
Why is insertion performed at the rear?
Why is deletion performed at the front?
What happens to FRONT after deletion?
What happens to REAR after insertion?
What is the purpose of peek in a queue?
What is the difference between a stack and a queue?
O. Circular Queue
What is a circular queue?
Why is a circular queue required?
What problem exists in a simple linear queue?
What does it mean that the last position is connected to the first position?
How does a circular queue reuse free positions?
What is the purpose of the modulo operation in a circular queue?
How do you determine the next position of REAR?
How do you determine the next position of FRONT?
What is the difference between a linear queue and a circular queue?
Explain circular queue overflow.
Explain circular queue underflow.
P. Priority Queue
What is a priority queue?
How is a priority queue different from an ordinary queue?
Does the first inserted element always leave first in a priority queue?
What determines which element is deleted?
Give a real-world example of a priority queue.
What happens if two elements have the same priority?
What is peekPriority()?
Where are priority queues used in operating systems?
Q. Deque
What is a deque?
What does "double-ended queue" mean?
From which ends can insertion take place in a deque?
From which ends can deletion take place?
What is insertFront()?
What is insertRear()?
What is deleteFront()?
What is deleteRear()?
How is a deque different from a queue?
How is a deque different from a stack?
Give one real-world application of a deque.
R. Sparse Matrix
What is a sparse matrix?
When do we call a matrix sparse?
Why should a sparse matrix be stored using a special representation?
What is triplet representation?
What information is stored in a triplet?
Why does a sparse representation save memory?
What is the purpose of storing the number of non-zero terms?
Convert the following matrix into triplet form:
0 0 5
0 0 0
7 0 0
What is sparse matrix transpose?
What is fast transpose?
Why is fast transpose better than the simple transpose method?
Can two sparse matrices be added if their dimensions are different?
What condition is required for sparse matrix multiplication?
Give one practical application of sparse matrices.
S. List Data Structure
What is a list?
What are the common operations performed on a list?
What is the difference between an array list and a linked list?
What is an unordered list?
What is an ordered list?
Give an example of an unordered list.
Give an example of an ordered list.
What is ordered insertion?
Why must ordered insertion maintain the ordering criterion?
What happens if an element is inserted at the wrong position in an ordered list?
What is the difference between insertBeginning() and insertEnd()?
What is the difference between deleting by position and deleting by value?
What is list traversal?
What is list concatenation?
What is the difference between merge and concatenate?
Why might searching be more efficient in an ordered list?
When would you prefer an unordered list?
When would you prefer an ordered list?
T. Integrated Thinking Questions
These questions are particularly useful for viva verification, because students must reason rather than repeat definitions.
If you need LIFO, which data structure would you select and why?
If you need FIFO, which data structure would you select and why?
If both insertion and deletion are required at both ends, which structure would you choose?
If elements have different priorities, which structure would you choose?
If a matrix contains 95% zero values, which representation would you consider?
If you need direct access using an index, which structure is appropriate?
Why would you choose a linked list instead of an array?
Why would you choose an array instead of a linked list?
If you need to process the most important task first, which queue would you use?
If you need to evaluate an arithmetic expression, why is a stack useful?
If you need to store student details such as roll number, name, and marks, which C data type would you use?
If you need to store 100 student marks, would you use 100 separate variables or an array? Why?
If you repeatedly insert elements in the middle of a collection, would an array always be a good choice? Explain.
If memory contains many zero values in a matrix, why is storing every zero inefficient?
Which data structure would you select for browser back-history? Why?
Which data structure would you select for a printer waiting line? Why?
Which data structure would you select for CPU tasks having different priorities? Why?
Which data structure would you select for undo/redo operations? Explain your choice.
Explain the difference between data structure selection and algorithm selection.
Why can the same problem sometimes be solved using different data structures?