What Are Data Structures?
Data structures are basically two different ways of storing exactly the same set of data
and as you can see they have sort of different structures and so these are simplified
examples of what data structures look like now if you 're already familiar with data
structures you might notice that the first method corresponds to the array or a list data
structure. The second method is the hash table or hash map data structure so what are
algorithms one way to define what they are would be that there are the operations we
can perform on different data structures. An algorithm is basically you have a problem
you're going to solve in this case finding the shortest path from home to school and
then you have systematic instructions for solving that problem. Depending on what data
structure you're using to store the data that you're performing the algorithm on your
algorithm might look slightly differently you might even have in some cases completely
different algorithms for solving the same problem.
An Overview of Arrays and Memory
An array an array is basically a collection of items of a single type, so an example would
be this one which is an array of integers or strings. it's not usual for an array to have
multiple types, so it 's not usual to have something like this where this array has both
strings and numbers inside and let 's take a look at some code snippets. In c.. There are
mainly two mechanisms for storing data on your computer. The first one is memory or
it's sometimes called ram.. The second one is storage, which has different types. For
example, a flash drive hard disk hard disk or a solidstate drive.. The data on storage is
permanent, while the data on memory is permanent. data on memory just disappears as
soon as you switch off your laptop. when you have applications on your computer
they're stored on storage. Originally, but when you launch one of them let 's say Google
Chrome it's gon na be loaded onto memory so that it's faster to use and you know faster
to access there. if you start running too many applications at the same time, you might
actually start running out of memory space.
Introduction to Classes and Objects
● Classes and objects are important concepts in programming.
, ● Objects are collections of properties (variables) and functions that represent
something.
● Objects can represent anything, such as a person, a dog, or a robot.
● A class is a blueprint that defines the properties and methods of an object.
● A class is a general category or type of object, and doesn't refer to any particular
object.
● When you create an object using a class, you can specify its properties, such as
name, color, and weight.
● Attributes are the properties or variables of an object, such as a person's name or
a dog's breed.
● Methods are the functions or actions that an object can perform, such as a
person's ability to walk or a dog's ability to bark.
● Constructors are special methods that are used to create new objects based on a
class.
Introduction to Linked Lists
A linked list is a linear data structure that is commonly used in computer science for
efficient data storage and manipulation. It consists of a sequence of nodes, each of
which contains two parts: the data and a reference to the next node in the sequence.
Linked lists are typically used when the number of elements to be stored is not known in
advance, or when the elements are expected to change frequently. They offer several
advantages over other data structures such as arrays, including the ability to efficiently
insert or delete elements anywhere in the list.
The two main types of linked lists are singly linked lists and doubly linked lists. In a
singly linked list, each node contains a reference to the next node in the sequence, while
in a doubly linked list, each node contains references to both the next and previous
nodes in the sequence.