COMSCI 1201 LEC (Data Structures & Algorithms)

studied byStudied by 35 people
5.0(3)
get a hint
hint

refers to a collection of individual values that can take many forms, such as text, images, audio, or video, usually represented with the help of characters such as alphabets, digits, or special characters.

1 / 51

Studying Progress

0%
New cards
52
Still learning
0
Almost done
0
Mastered
0
52 Terms
1
New cards

refers to a collection of individual values that can take many forms, such as text, images, audio, or video, usually represented with the help of characters such as alphabets, digits, or special characters.

Data

New cards
2
New cards

examples of data are:

names, ages, prices, costs, numbers of items sold, employee names, etc.

New cards
3
New cards

Data themselves are fairly useless, but when these data are processed or organized, they become useful and is now called__

information.

New cards
4
New cards

data needs to be __ to provide information.

organized

New cards
5
New cards

__ is a storage that is used to store and organize data. It is a way of arranging data on a computer so that it can be accessed and updated efficiently.

data structure

New cards
6
New cards

it easy for users to access and work with the data they need in appropriate ways.

data structure

New cards
7
New cards

Data Structure It is not only used for organizing the data but also for ___using various algorithms.

processing, retrieving, and storing data

New cards
8
New cards

Data structure is classified into two types

primitive and non-primitive.

New cards
9
New cards

Also known as basic data structure, it contains fundamental data types that can only hold single data type values.

Primitive data structure

New cards
10
New cards

Examples of primitive data

integer, character, boolean, float, double, long, etc.

New cards
11
New cards

a data structure that focuses on forming a set or collection of data elements that is either homogeneous or heterogeneous

Non-primitive data structure

New cards
12
New cards

What is Homogenous and its example?

(same data type. ex. integer array num)

New cards
13
New cards

What is Heterogeneous

and its example?

(different data types. ex. structure Student that contains char array name, integer age, etc.)

New cards
14
New cards

Non-primitive data structure also known as ___, as they are derived on primitive ones.

derived data structure

New cards
15
New cards

A ___ can be stored using the non- primitive data structures.

large number of values

New cards
16
New cards

The data stored can also be manipulated using various operations like

  • insertion,

  • deletion,

  • searching,

  • sorting,

New cards
17
New cards

Non-primitive data structures are divided into two categories:

linear and non-linear data structures

New cards
18
New cards

a type of data structure in which data elements are arranged sequentially or linearly.

Linear data structure

New cards
19
New cards

Since elements are arranged in a sequential or particular order, linear data structure is __

easier to access.

New cards
20
New cards

Examples of linear data structures are__

array, stack, queue, and linked list.

New cards
21
New cards

When the elements of a data structure doesn't stay sequentially or linearly, the data structure is called to be __

Non-linear data structure

New cards
22
New cards

Since the data structure is non-linear, it does not involve a__. Therefore, they can’t_ all of its elements in a single run.

  • single level

  • traverse

New cards
23
New cards

examples of non-linear data structures.

Trees and graphs

New cards
24
New cards

What are the Data Structure Operations ( enumerate)

  • Navigating

  • Searching

  • Insertion

  • Deletion

  • Sorting

  • Merging

New cards
25
New cards

Accessing each data element exactly once so that certain items in the data may be processed

Navigating

New cards
26
New cards

Finding the location of the data element or key in the structure.

Searching

New cards
27
New cards

Adding a new data element to the structure

Insertion

New cards
28
New cards

Removing a data element from the structure

Deletion

New cards
29
New cards

Arrange the data elements in a logical order (ascending/descending)

Sorting

New cards
30
New cards

Combining data elements from two or more data structures into one

Merging

New cards
31
New cards

defined as a step-by-step procedure or method with a finite set of instructions to accomplish a particular task.

algorithm

New cards
32
New cards

Basically, it is not the complete code, rather it is the__ that can be implemented to solve a particular problem.

logic

New cards
33
New cards

While defining an algorithm, steps are written in human understandable language and independent of any programming language, which are usually represented by using___

flowcharts or pseudocode.

New cards
34
New cards

Algorithm =

Algorithm = Input + Process + Output

New cards
35
New cards

What are the Characteristics of an Algorithm ( enumerate)

  • Unambiguous

  • Inputs

  • Outputs

  • Correctness

  • Finiteness

  • Effectiveness

  • Language Independent

New cards
36
New cards

Instructions in an algorithm should be clear, simple, and straightforward.

Unambiguous

New cards
37
New cards

An algorithm should have some input values.

Inputs

New cards
38
New cards

At the end of an algorithm, you must have one or more outcomes.

Outputs

New cards
39
New cards

An algorithm is designed correctly if it receives valid input, terminates, and always returns the correct output.

Correctness

New cards
40
New cards

The algorithm should contain a limited and countable number of instructions and should terminate after a finite time.

Finiteness

New cards
41
New cards

Each step of the algorithm should be effective and efficient enough to produce results.

Effectiveness

New cards
42
New cards

The effectiveness of an algorithm can be evaluated with the help of two important parameters:

  1. Time Complexity

  2. Space Complexity

New cards
43
New cards

This refers to the amount of time taken by the computer to run the algorithm.

Time Complexity

New cards
44
New cards

the total space taken or amount of computational memory needed by the algorithm to solve a problem.

Space Complexity

New cards
45
New cards

Instructions in an algorithm can be implemented in any language and produce the same results.

Language Independent

New cards
46
New cards

Data Flow of an Algorithm (enumerate)

  • Problem

  • Algorithm

  • Input

  • Processing Unit

  • Output

New cards
47
New cards

usually gives the programmer an idea of the issue at hand, the available resources and the motivation to come with a plan to solve it.

Problem

New cards
48
New cards

programmer designs the step by step procedure to solve the problem efficiently.

Algorithm

New cards
49
New cards

algorithm is designed and the relevant inputs are supplied.

Input

New cards
50
New cards

receives these inputs and processes them as per the designed algorithm.

Processing Unit

New cards
51
New cards

receive the favorable output of our problem statement

Output

New cards
52
New cards

What Makes a Good Algorithm?

• It must be correct • It must be finite (in terms of time and size) • It must terminate • It must be unambiguous • It must be space and time efficient

New cards

Explore top notes

note Note
studied byStudied by 31 people
Updated ... ago
5.0 Stars(3)
note Note
studied byStudied by 16 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 30 people
Updated ... ago
5.0 Stars(2)
note Note
studied byStudied by 13 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 6 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 3 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 10 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 28237 people
Updated ... ago
4.9 Stars(86)

Explore top flashcards

flashcards Flashcard92 terms
studied byStudied by 3 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard67 terms
studied byStudied by 2 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard35 terms
studied byStudied by 1 person
Updated ... ago
5.0 Stars(1)
flashcards Flashcard77 terms
studied byStudied by 90 people
Updated ... ago
5.0 Stars(4)
flashcards Flashcard47 terms
studied byStudied by 22 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard39 terms
studied byStudied by 8 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard43 terms
studied byStudied by 19 people
Updated ... ago
5.0 Stars(3)
flashcards Flashcard138 terms
studied byStudied by 6 people
Updated ... ago
5.0 Stars(2)