5. WHAT IS MEMORY IN COMPUTER SCIENCE?
• Memory is the area where the computer stores or remembers data.
• Some types of computer memory are designed to be very fast, meaning that the
central processing unit (CPU) can access data stored there very quickly.
• Your computer's main memory is called RAM (Random Access Memory).
• You can think of it as a workspace the computer uses to get work done. When you double-
click on an app, or open a document, or, well, do much of anything, RAM gets used to store
that data while the computer is working on it.
• H
6. WHY IS MEMORY IMPORTANT?
• RAM allows your computer to perform many of its everyday tasks, such as
loading applications, browsing the internet, editing a spreadsheet, or
experiencing the latest game.
• Memory also allows you to switch quickly among these tasks, remembering
where you are in one task when you switch to another task.
• It holds the data and instructions that the Central Processing Unit (CPU) needs
• This allows the CPU direct access to the computer program.
• Memory is needed in all computers
9. WHAT IS GARBAGE COLLECTION?
• The garbage collector (GC) manages the allocation and release of memory
• When there isn't enough memory to allocate an object, the GC must collect and
dispose of garbage memory to make memory available for new allocations. This
process is known as garbage collection.
• Garbage Collection in C# has the following advantages −
• You don’t need to free memory manually while developing your application.
• It also allocates objects on the managed heap efficiently.
• When objects are no longer used then it will reclaim those objects by
clearing their memory and keeps the memory available for future
allocations.
• Managed objects automatically get clean content to start with, so their
constructors do not have to initialize every data field.
12. WHAT IS BIG O NOTATION?
• Big O notation is used in Computer Science to describe the performance or complexity of an
algorithm.
• Big O specifically describes the worst-case scenario, and can be used to describe the execution
time required or the space used (e.g. in memory or on disk) by an algorithm.
• Big O notation is a measure of the complexity of your program in terms of the size of the input.
• The size of the input is usually denote as ‘n’. There are usually 2 ways to measure the complexity:
• Time: The number of calculations your program must perform on the input data to get the output.
• For example finding the biggest number in a list of n numbers requires you to check every number
against against your current maximum and see if the new number is higher. Thus for n numbers you need
n checks, or calculations. This has linear time complexity because there is a 1 to 1 relationship between
input the number of calculations to obtain the output. Linear time complexity is denoted as O(n).
• Space: The amount of storage space needed by the program to run its calculations.
• We will use the above example of finding the biggest number in a list of n numbers. We need a variable
to store our current maximum number value. If we have 10 numbers, we need 1 variable, if we have a
million numbers, we still need 1 variable. The number of variables we need is constant compared to the
input size, so our program has constant space complexity, denoted as O(1).
13. LIVE WALKTHRU/EXPLANATION
• Write code for each of the runtimes discussed
• Share out – the class will guess what runtime your code is displaying
16. WHAT IS A DOUBLY LINKEDLIST?
• In computer science, a doubly linked list is a linked data structure that consists of a set
of sequentially linked records called nodes. Each node contains three fields: two link
fields and one data field.
17. THE DIFFERENCE BETWEEN A LINKEDLIST AND
DOUBLY LINKEDLIST
• A Doubly LinkedLists has references that goes both ways compared to a Singly
LinkedList that has references pointing one way
21. DISCUSSION
• Why is this important?
• How can this be useful to me?
• How can I use this in my current
job?
• How can I use this in my future
career?
• What will I get out of this?
• How is this used in the real world
Regroup and discuss after…