0% found this document useful (0 votes)
8 views

Basic Computer Science Notes

Uploaded by

hi.im.huggles
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Basic Computer Science Notes

Uploaded by

hi.im.huggles
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Section 1: What is Computer Science?

• Definition:
o Computer Science is the study of computers, computational systems,
and the theoretical foundations of information and computation.
o Focuses on algorithmic processes, hardware and software design, and
data structures.
• Key Areas of Study:
o Algorithms: Step-by-step instructions for solving problems.
o Programming Languages: Tools to write software, such as Python, Java,
C++.
o Data Structures: Ways to organize and store data for efficient access and
modification (e.g., arrays, linked lists).
o Artificial Intelligence: Creating machines that can simulate human
intelligence.
• Brief History:
o Charles Babbage: Designed the first mechanical computer, the
Analytical Engine.
o Alan Turing: Considered the father of theoretical computer science;
introduced the concept of the Turing machine.
o Grace Hopper: Developed the first compiler, an essential tool for
translating high-level programming languages into machine code.

Section 2: Algorithms and Problem-Solving

• What is an Algorithm?:
o A step-by-step procedure or formula for solving a problem.
o An algorithm must have input, output, and a clear set of operations.
• Algorithm Complexity:
o Time Complexity: The amount of time an algorithm takes to complete
based on the size of the input (measured in terms of Big O notation).
o Space Complexity: The amount of memory an algorithm uses as it
processes data.
• Big O Notation:
o Describes the upper bound of an algorithm's runtime or memory usage.
o Common complexities:
▪ O(1): Constant time, irrespective of input size.
▪ O(n): Linear time, increases proportionally with input size.
▪O(log n): Logarithmic time, decreases drastically as the input size
grows.
▪ O(n^2): Quadratic time, commonly found in nested loops.
• Common Algorithms:
o Sorting Algorithms: (e.g., Bubble Sort, Merge Sort, Quick Sort).
o Search Algorithms: (e.g., Binary Search, Linear Search).

Section 3: Programming Languages

• What is a Programming Language?:


o A formal set of instructions that can be used to produce various kinds of
output.
o Programming languages are used to write programs that control the
behavior of a machine or express algorithms.
• Types of Programming Languages:
o Low-Level Languages:
▪ Machine Language: Directly understood by the computer's CPU
(binary code).
▪ Assembly Language: Uses symbolic instructions but is still close
to machine language.
o High-Level Languages:
▪ Easier for humans to understand and write (e.g., Python, Java,
C++).
▪ Translated to machine code via a compiler or interpreter.
• Popular Programming Languages:
o Python: Versatile, beginner-friendly, used in web development, data
science, AI.
o Java: Platform-independent, widely used in enterprise applications.
o C++: Offers a balance of low-level control and high-level ease, often used
in game development.
o JavaScript: Key language for web development, especially for front-end
user interfaces.
• Syntax vs. Semantics:
o Syntax: The rules governing the structure of a language (how to write code
correctly).
o Semantics: The meaning behind the written code (what the code does).
Section 4: Data Structures

• What is a Data Structure?:


o A specialized format for organizing, processing, retrieving, and storing
data.
o Efficient data structures are crucial for designing efficient algorithms.
• Common Data Structures:
o Arrays: A collection of items stored at contiguous memory locations. All
elements are of the same type.
▪ Time Complexity: Access: O(1), Insertion/Deletion: O(n).
o Linked Lists: A linear collection of data elements where each element
points to the next. Elements are not stored in contiguous locations.
▪ Time Complexity: Access: O(n), Insertion/Deletion: O(1) at head.
o Stacks: Follows Last In, First Out (LIFO) principle. Used in function call
management and undo features.
o Queues: Follows First In, First Out (FIFO) principle. Useful in task
scheduling.
o Trees: A hierarchical data structure. Commonly used tree types include
binary trees, binary search trees (BST), and AVL trees.
o Hash Tables: Provides a mapping from keys to values, allowing constant
time (O(1)) insertion, deletion, and lookup on average.
• Use of Data Structures:
o Choosing the right data structure impacts algorithm performance
significantly, depending on the operation requirements (e.g., fast lookup,
frequent updates).

Section 5: Artificial Intelligence and Machine Learning

• What is Artificial Intelligence (AI)?:


o The simulation of human intelligence in machines that are designed to
think, learn, and solve problems.
o AI applications include voice recognition (Siri, Alexa), self-driving cars,
and recommendation systems (Netflix, YouTube).
• Machine Learning:
o A subset of AI where machines learn from data without being explicitly
programmed.
o Types of machine learning:
▪ Supervised Learning: The machine is trained using labeled data
(input-output pairs).
▪ Unsupervised Learning: The machine is given input data without
labeled outcomes and must find patterns or groupings.
▪ Reinforcement Learning: The machine learns through trial and
error, receiving rewards or penalties for actions.
• Neural Networks:
o Modeled after the human brain, neural networks consist of layers of
nodes (neurons) that can learn and make decisions.
o Used in image recognition, natural language processing, and more.
• Ethical Considerations in AI:
o Concerns include job displacement, biases in decision-making systems,
and the development of autonomous weapons.
o Importance of ensuring transparency, fairness, and accountability in AI
systems.

You might also like