MODULE 1: Arrays

0.0(0)
studied byStudied by 5 people
0.0(0)
full-widthCall with Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/10

flashcard set

Earn XP

Description and Tags

Prelim Topic

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No study sessions yet.

11 Terms

1
New cards

Array

  • A type of linear data structure that is defined as a collection of elements with same or different data types

  • Exist in both single and multiple dimensions

  • Used when there is a necessity to store multiple elements of similar nature together at one place

2
New cards

Element

  • Each item stored in an array is called an element

3
New cards

Index

  • Each location of an element in an array has a numerical index, which is used to identify the element

4
New cards

Single-Dimensional Arrays

  • Indexed from 0 to n-1, where n is the total size of the array
    - Ex: An array of size 10 has buckets indexed from 0 to 9

5
New cards

Multidimensional Arrays

  • It can be thought of as “sub-buckets” within each main bucket.

  • Indexing Format: array_name[m][n]

  • m and n represent the sizes or indices at each level of the array

  • This structured indexing is what enables the efficient O(1) random access property of arrays

6
New cards

Insertion

(Array Operation)

  • A new element can be added at the beginning, end, or any given index of array. This is done using input statements of the programming languages

7
New cards

Deletion

(Array Operation)

  • In this operation, we erase an element from the particular index of an array. This operation takes place as we assign the value in the consequent index to the current index.

8
New cards

Search

(Array Operation)

  • Looking for an element in the array using a key; The key element sequentially compares every value in the array to check if the key is present in the array or not

9
New cards

Traversal

(Array Operation)

  • This operation traverses through all the elements of an array. We use loop statements to carry this out

10
New cards

Update

(Array Operation)

  • This operation refers to updating an existing element from the array at given index

11
New cards

Display

(Array Operation)

  • This operation displays all the elements in the entire array using a print statement

Explore top flashcards

October exam
Updated 465d ago
flashcards Flashcards (32)
10/6
Updated 218d ago
flashcards Flashcards (62)
PSCH 262 Final Exam
Updated 634d ago
flashcards Flashcards (110)
WWII
Updated 4d ago
flashcards Flashcards (35)
October exam
Updated 465d ago
flashcards Flashcards (32)
10/6
Updated 218d ago
flashcards Flashcards (62)
PSCH 262 Final Exam
Updated 634d ago
flashcards Flashcards (110)
WWII
Updated 4d ago
flashcards Flashcards (35)