CS301_Short_Notes_By_Swera_Updated.pdf
Verified academic study resource for CS301 (Data Structures) under the Computer Science at Virtual University of Pakistan. This PDF document (Official Lecture Handouts & Highlighted Notes) covers Complete Course Handouts (Lectures 1 to 45) spanning approximately 450 pages across 8 curriculum modules, and is indexed for student examination review with instant in-browser preview and 100% free direct download.
- Course
- CS301 – Data Structures
- Faculty
- Computer Science
- Format
- Type
- Handout
- Coverage
- Complete Course Handouts (Lectures 1 to 45)
Virtual University examiners construct 100% of objective MCQs and subjective marking schemes directly from the official CS301 handouts.
What this file covers — CS301 syllabus roadmap
- Core Architecture, Syntax & Primitive Data Structures — Lectures 1 to 6 (Pages 1 to 65). 15% Objective Marks (8–10 MCQs)
- Conditional Branching, Loops & Logical Control Flow — Lectures 7 to 12 (Pages 66 to 140). 18% Exam Marks (MCQs + 2-Mark Short Questions)
- Memory Management, Pointers, Arrays & Functions — Lectures 13 to 18 (Pages 141 to 215). 22% Exam Marks (High Yield for Midterms)
- Midterm Consolidation, Strings & Algorithm Synthesis — Lectures 19 to 22 (Pages 216 to 280). Midterm Exam Culmination (Lectures 1–22 Scope)
- Object-Oriented Paradigms: Classes & Data Abstraction — Lectures 23 to 29 (Pages 281 to 360). 16% Final-Term Marks (Core OO Concepts)
- Inheritance Hierarchies & Dynamic Polymorphism — Lectures 30 to 36 (Pages 361 to 435). 20% Final-Term Marks (Virtual Functions & V-Tables)
- Templates, Standard Library & Persistent File I/O — Lectures 37 to 41 (Pages 436 to 510). 14% Final-Term Marks (Generic Code & Streams)
- Final-Term Examination Dossier & Capstone Synthesis — Lectures 42 to 45 (Pages 511 to 585). Final-Term Exam Synthesis (Lectures 23–45 Scope)
Frequently asked questions
Where can I download CS301_Short_Notes_By_Swera_Updated.pdf for free?
You can preview and download "CS301_Short_Notes_By_Swera_Updated.pdf" (CS301 PDF, ~450 pages) directly from the MIHORA VU Study Library (https://study.mihora.tech/doc/cs301-short-notes-by-swera-updated-pdf) with 100% free high-speed downloads and zero registration requirements.
What syllabus chapters and lectures are covered in this CS301 file?
This document covers Complete Course Handouts (Lectures 1 to 45) across 8 distinct lecture units (Lectures 1 to 6, Lectures 7 to 12, Lectures 13 to 18, Lectures 19 to 22, Lectures 23 to 29, Lectures 30 to 36, Lectures 37 to 41, Lectures 42 to 45), featuring comprehensive definitions, solved objective questions, and examiner marking rubrics.
What is the passing criteria for CS301 under the VU 20% Two-Half Rule?
Under official Virtual University regulations, students must score at least 20% in the First Half (Quizzes, Assignments, GDBs, and Midterm combined) AND independently at least 20% in the Final-Term examination paper. Scoring under 20% in the final exam results in an automatic F grade regardless of earlier marks.
Are CS301 solved past papers and handouts verified for 2026 exams?
Yes. All CS301 materials on MIHORA VU—including Moaaz, Waqar Siddhu, and team archives—are reviewed against the current VU syllabus to help students prepare for 2026 Midterm, Final-Term, and online quiz examinations.
Inside this file
Lecture No.23
Single right rotation
Is applied when a node is insert in right subtree.
ALGORITHM:
STEP 1: START.
STEP 2: INITIALIZE arr[] ={1, 2, 3, 4, 5 }.
STEP 3: length= sizeof(arr)/sizeof(arr[0])
STEP 4: SET n =3.
STEP 5: PRINT "Original Array"
STEP 6: SET i=0. REPEAT STEP 7 and STEP 8 UNTIL i<length.
STEP 7: PRINT arr[i]
STEP 8: i=i+1.
Single left rotation
Is applied when a node is inserted in a left subtree
ALGORITHM:
STEP 1: START.
STEP 2: INITIALIZE arr[] ={1, 2, 3, 4, 5 }.
STEP 3: length = sizeof(arr1)/sizeof(arr1[0])
STEP 4: length = sizeof(arr)/sizeof(arr[0])
STEP 5: SET n =3.
STEP 6: SET i=0. REPEAT STEP 7 to STEP 8 UNTIL i<length.
STEP 7: PRINT arr[i]
STEP 8: i = i+1.
A double right rotation, or right-left rotation, or simply RL, is a rotation that must be performed
when attempting to balance a tree which has a left subtree, that is right heavy. This is a mirror
operation of what was illustrated in the section on Left-Right Rotations, or double left rotations.
Double left right rotation Carries out single left rotation at first
Deleting a node from an AVL tree is similar to that in a binary search tree. Deletion may disturb
the balance factor of an AVL tree and therefore the tree needs to be rebalanced in order to
maintain the AVLness. For this purpose, we need to perform rotations
Lecture No.24
Other uses of binary trees
Binary Search Tree is a tree that allows fast search, insert, delete on a sorted data. It also allows
finding closest item. Heap is a tree data structure which is implemented using arrays and used to
implement priority queues. B-Tree and B+ Tree: They are used to implement indexing in
databases.
An expression tree is a representation of expressions arranged in a tree-like data structure
Parse tree is the hierarchical representation of terminals or non-terminals. These symbols
(terminals or non-terminals) represent the derivation of the grammar to yield input strings. ... The
starting symbol of the grammar must be used as the root of the Parse Tree. Leaves of parse tree
represent terminals
Parse tree for an SQL Query
A parse tree is a data structure for representing a parsed statement. Parsing a statement requires
the grammar of the language (quest language, e.g., MySQL, MS-SQL, etc.) that the statement
was written.
In computing , an optimizing compiler is a compiler that tries to minimize or maximize some
attributes of an executable computer program. Common requirements are to minimize a
program's execution time, memory footprint, storage size, and power consumption
Lecture No.25
An expression tree is a representation of expressions arranged in a tree-like data structure. In
other words, it is a tree with leaves as operands of the expression and nodes contain the
operators. Similar to other data structures, data interaction is also possible in an expression tree.
Huffman coding is a lossless data compression algorithm. The idea is to assign variable-length
codes to input characters, lengths of the assigned codes are based on the frequencies of
corresponding characters. The most frequent character gets the smallest code and the least
frequent character gets the largest code.
Lecture No.26
*Huffman encoding*is used in data compression.
Mathematical properties of binary tree
The path length of a tree is the sum of the levels of all the tree's nodes. The internal path length
of a binary tree is the sum of the levels of all the tree's internal nodes. The external path length of
a binary tree is the sum of the levels of all the tree's external nodes.
Lecture No.27
Let's now focus on some basic properties of a binary tree:
A binary tree can have a maximum of nodes at level if the level of the root is zero.
When each node of a binary tree has one or two children, the number of leaf nodes (nodes with
no children) is one more than the number of nodes that have two children.
In computing, a threaded binary tree is a binary tree variant that facilitates traversal in a
particular order. An entire binary search tree can be easily traversed in order of the main key, but
given only a pointer to a node, finding the node which comes next may be slow or impossible.
A threaded insert, also known as a threaded bushing, is a fastener element that is inserted into an
object to add a threaded hole.
In Binary Tree, Inorder successor of a node is the next node in Inorder traversal of the Binary
Tree. ... In Binary Search Tree, Inorder Successor of an input node can also be defined as the
node with the smallest key greater than the key of the input node
Inorder traversal
Definition: Process all nodes of a tree by recursively processing the left subtree, then processing
the root, and finally the right subtree. Also known as symmetric traversal
Lecture No.28
Inorder traversal in threaded trees: inorder routine =left
/* The inorder routine for threaded binary tree */
TreeNode* nextInorder(TreeNode* p){
if(p->RTH == thread) return(p->R);
else {
p = p->R;
while(p->LTH == child)
p = p->L;
return p;
}
}
Complete binary tree
A binary tree in which every level (depth), except possibly the deepest, is completely filled. At
depth n, the height of the tree, all nodes must be as far left as possible.
Lecture No.29
The heap is an amorphous block of memory that your C++ program can access as necessary.
A max-heap is a complete binary tree in which the value in each internal node is greater than or
equal to the values in the children of that node.
Insert -2 into a following heap:
Insert a new element to the end of the array:
In the general case, after insertion, heap property near the new node is broken:
To restore heap property, algorithm sifts up the new element, by swapping it with its parent:
Now heap property is broken at the root node:
Keep sifting:
Lecture No.30More CS301 files
- CS301 & CS301P Short Notes By Qalb-e-Momin .pdf (PDF · Handout)
- CS301 Handouts (Updated) by MS.pdf (PDF · Handout)
- CS301 Handouts by MS S26.pdf (PDF · Handout)
- CS301 Handouts by MS.pdf (PDF · Handout)
- CS301 Handouts by MS.pdf (PDF · Handout)
- CS301 HighLight Notes.pdf (PDF · Handout)
- CS301 Highlight Handout By Vu Topper RM.pdf (PDF · Handout)
- CS301 Highlight Handout By Vu Topper RM.pdf (PDF · Handout)