- Type
- Midterm past paper
- Course
- CS301 Data Structures
- Size
- PDF 4.2 MB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extensionSign in with the extension for 30 a day.
Preview text
Text from pages 1, 2, 3 of 125. Download the file for all 125 pages.
CS301 Mid term Notes
Lec 1 to 22
Data Structures Lecture No. 01
Data structures
Data structures are used to store data in a computer in an organized form. In C++ language, Different types of data structures are; Array, Stack Queue, Linked List, and Tree. Sorting technique is merge sort, shell sort, bubble sort, Quick sort, Selection sort, Heap sort etc.
Organizing Data
- Any organization for a collection of records that can be searched, processed in any order, or modified.
- The choice of data structure and algorithm can make the difference between a program running in a few seconds or many days.
Data Structures
Data Structures are a specialized means of organizing and storing data in computers in such a way that we can perform operations on the stored data more efficiently.
Most Common 8 Data structures are as follows:
- Arrays
- Linked Lists
- Stacks
- Queues
- Hash Tables
- Trees
- Heaps
- Graphs
Arrays
An ordered and index able sequence of values. C++ supports arrays of a single dimension (a vector) or of multiple dimensions. Elementary data structure that exists as built-in in most programming languages.
#include <iostream>
using namespace std;
main( int argc, char** argv )
int x[6];
int j;
for(j=0; j < 6; j++)
x[j] = 2*j;
Array operations
- Traverse: Go through the elements and print them.
- Search: Search for an element in the array. You can search the element by its value or its index.
- Update: Update the value of an existing element at a given index.
Inserting elements to an array and deleting elements from an array cannot be done straight away as arrays are fixed in size. If you want to insert an element to an array, first you will have to create a new array with increased size (current size +
- , copy the existing elements and add the new element. The same goes for the deletion with a new array of reduced size.
Applications of arrays
- Used as the building blocks to build other data structures such as array lists, heaps, hash tables, vectors and matrices.
- Used for different sorting algorithms such as insertion sort, quick sort, bubble sort and merge sort.
The LIST Data Structure
- The List is among the most generic of data structures.
Real life:
Lists LONG OR SHORT OR Quiz
- A list is collection of items that are all of the same type (grocery items, integers, names).
- The items, or elements of the list, are stored in some particular order.
- It is possible to insert new elements into various positions in the list and remove any element of the list.
- List is a set of elements in a linear order. For example, data values a1, a2, a3, a4 can be arranged in a list:
(a3, a1, a2, a4)
In this list, a3, is the first element, a1 is the second element, and so on
- The order is important here; this is not just a random collection of elements, it is an ordered collection.
List Operations FOR MCQ
Related CS301 files
All CS301 files →- CS301 Midterm Solved Quiz 1 and 2 Fall 2012 Midterm DOC 1.1 MB
- CS301 Midterm Past Papers Fall 2017 Midterm DOCX 19 KB
- CS301 Midterm Quiz 1 by MCS Group Midterm PDF 2 MB
- CS301 Midterm Short Notes 2021 Set 2 Midterm PDF 325 KB
- CS301 Highlighted Handouts by Qalb-e-Momin Highlighted PDF 7.1 MB
- CS301 Quiz 1 May 2026 Quiz PDF 41 KB
Get more out of VUBuddy, for free
- Unlimited downloads
- The explanation behind every MCQ answer
- Study offline on slow data
- 30 downloads a day instead of 3
- Sign in and buy Pro Semester here
One Pro Semester membership works in both the extension and the app.