1/119
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
using System;
Gives access to Console and other basic tools.
namespace SampleApp
Groups related classes and code.
class Program
C# is class-based; all code lives in classes.
static void Main(string[] args)
Main method where execution begins.
Console.WriteLine()
Built-in method for printing to the screen.
C# (C-Sharp)
A modern, object-oriented programming language developed by Microsoft.
.NET Framework
A software development platform developed by Microsoft that includes a large class library and provides language interoperability.
Microsoft Visual Studio
A powerful integrated development environment (IDE) used to develop C# applications.
int
4 bytes; used for whole numbers.
float
4 bytes; used for decimal numbers (less precision).
double
8 bytes; used for decimal numbers (more precision).
char
2 bytes; used for a single character.
string
Varies; used for text or group of characters.
bool
1 byte; used for True/False values.
C# Syntax
Defines how code is written so that the compiler can understand and execute it.
Semicolon (;)
Ends a statement.
Braces {}
Groups code blocks used in methods and classes.
Main method
Program entry point.
Control structures
Allow decision-making and repetition in programs.
Variables
Containers for storing data.
Rules for variable names
Must start with a letter or underscore, can't use reserved words, case-sensitive, and should use meaningful names.
const double Pi
A constant value representing the mathematical Pi, set to 3.1416.
for loop
Repeats a block for a known number of times.
Conditional Statements
Control structures that execute different actions based on whether a specified condition is true or false.
Switch Statement
A control statement that allows a variable to be tested for equality against a list of values.
Loops
Control structures that repeat a block of code multiple times.
Declaration
The process of defining a variable's type and name.
Initialization
The process of assigning a value to a variable at the time of declaration.
Variable Naming Rules
Variables must start with a letter or underscore, cannot use reserved words, are case-sensitive, and should have meaningful names.
Constants
Fixed values that cannot be changed once set, declared using the 'const' keyword.
Algorithm
A step-by-step procedure or set of rules for solving a problem or performing a task.
Data Structure
An organized way to store and manage data for efficient access and modification.
Common Data Types
Basic types of data, including int (integers), double (floating-point numbers), char (single characters), string (sequence of characters), and bool (true/false values).
Arithmetic Operators
Operators used to perform mathematical operations: +, -, *, /, %.
Comparison Operators
Operators used to compare two values: ==, !=,
Logical Operators
Operators used to perform logical operations: && (AND), || (OR), ! (NOT).
Linear Data Structures
Data structures arranged in a sequence, such as Arrays, Linked Lists, Stacks, and Queues.
Non-Linear Data Structures
Data structures that are hierarchical or network-like, such as Trees and Graphs.
Hash-based Structures
Data structures that allow fast access via keys, such as Hash Tables.
Big-O Notation
A mathematical notation that describes the worst-case upper bound of an algorithm's running time.
Divide and Conquer
A strategy for solving problems by breaking them down into smaller subproblems, solving each subproblem independently, and combining their results.
Real-World Scenario for Algorithms
Examples of algorithms in practice, such as finding a word in a dictionary or organizing a tournament.
Type Inference
The ability of a programming language to automatically deduce the type of a variable.
Example of Variable Declaration
var name = 'Maria'; // string
Example of Variable Initialization
var age = 30; // int
Big O Notation (O)
Tells us the maximum work an algorithm could take.
Omega Notation (Ω)
Represents the lower bound of running time.
Theta Notation (Θ)
Represents the tight bound (average growth rate).
Divide and Conquer (D&C)
A problem-solving strategy where you break a problem into smaller subproblems, solve each subproblem, and merge the solutions.
Primitive Data Structure
These are predefined data, supported by the programming language, allowing storage of only single data type values.
Non-Primitive Data Structure
A data structure that allows you to store multiple data type values.
Linear List
The elements are arranged in sequence one after the other.
Non-Linear List
Elements in non-linear data structures are not in any sequence, arranged in a hierarchical manner.
Array Data Structure
In an array, elements in memory are arranged in continuous memory and all elements are of the same type.
Graph Data Structure
In graph data structure, each node is called vertex and each vertex is connected to other vertices through edges.
Stack Data Structure
In stack data structure, elements are stored in the LIFO principle.
Queue Data Structure
A data structure that follows the FIFO principle.
Linked List
A data structure consisting of nodes where each node points to the next node.
Worst-case scenario
The maximum time taken by an algorithm in the least favorable conditions.
Best-case scenario
The minimum time taken by an algorithm in the most favorable conditions.
Average-case scenario
The expected time taken by an algorithm under typical conditions.
Spanning Tree
A spanning tree is a subgraph that includes all the vertices of the graph with the minimum number of edges.
Minimum Spanning Tree
A minimum spanning tree is a spanning tree with the least total edge weight.
Strongly Connected Components
Strongly connected components are subgraphs where every vertex is reachable from every other vertex.
Adjacency Matrix
An adjacency matrix is a square matrix used to represent a finite graph, where the elements indicate whether pairs of vertices are adjacent.
Adjacency List
An adjacency list is a collection of lists or arrays that represent a graph, where each list corresponds to a vertex and contains the adjacent vertices.
Undirected Graph
An undirected graph is when each node has a reciprocal connection.
Directed Graph
A directed graph is a graph where edges have a direction, indicating a one-way relationship.
Tree Data Structure
A tree is a collection of vertices and edges with only one edge between any two vertices.
Binary Tree
A binary tree is a tree data structure where each node has at most two children.
Binary Search Tree
A binary search tree is a binary tree where the left child contains only nodes with values less than the parent node and the right child only nodes with values greater.
AVL Tree
An AVL tree is a self-balancing binary search tree where the difference in heights between left and right subtrees cannot be more than one.
B-Tree
A B-tree is a self-balancing tree data structure that maintains sorted data and allows searches, sequential access, insertions, and deletions in logarithmic time.
B+ Tree
A B+ tree is an extension of a B-tree that maintains all values at the leaf level and allows for efficient range queries.
Red-Black Tree
A red-black tree is a balanced binary search tree with an additional property that ensures the tree remains approximately balanced during insertions and deletions.
Linked List Data Structure
In linked list data structure, data elements are connected through a series of nodes, each containing data items and the address to the next node.
Pseudocode
It is a simpler version of a programming code in plain English which uses short phrases to write code for a program before it is implemented in a specific programming language.
Program
It is exact code written for a problem following all the rules of the programming language.
Relational Operators
These compare two values and return true or false, often used in decision-making.
Assignment Operators
These are used to assign values to variables, sometimes with operations.
if Statement
The if statement executes a block of code only when a condition is true.
if-else Statement
The if-else statement executes one block of code if the condition is true, and another if it is false.
if-else if Ladder
When there are multiple conditions to check, you use an if-else if ladder.
Arithmetic
Used in calculations (e.g., total cost in shopping cart).
Relational
Used for comparisons (e.g., checking pass/fail in grading).
Logical
Used in conditions (e.g., ATM withdrawal checks).
Assignment
Used to update values (e.g., updating fitness tracker steps).
while Loop
The while loop is used when the number of iterations is not known in advance—it runs as long as the condition is true.
do-while Loop
The do-while loop is similar to while, but it executes at least once, even if the condition is false.
foreach Loop
The foreach loop is used to iterate through a collection or array.
Two-Dimensional (2D) Array
A table-like structure (rows and columns). Accessed by two indices.
int[] scores = { 85, 90, 78, 92, 88 };
Creates a 1D array with 5 integers.
scores.Length
Gets the size of the array (5 elements).
int[,] grades
Declares a 2D array (matrix).
Outer loop (i)
Iterates through rows (students).
Inner loop (j)
Iterates through columns (subjects).
Insertion
Adding an element at an index - requires shifting elements.
Deletion
Removing an element at an index - requires shifting elements.
Traversal
Visiting elements of an array.
Searching
Finding a specific element in an array.