Topic 4: Programming (Searching, Sorting and Psuedocode)

studied byStudied by 0 people
0.0(0)
learn
LearnA personalized and smart learning plan
exam
Practice TestTake a test on your terms and definitions
spaced repetition
Spaced RepetitionScientifically backed study method
heart puzzle
Matching GameHow quick can you match all your cards?
flashcards
FlashcardsStudy terms and definitions

1 / 23

24 Terms

1

collecting input

input VARIABLE

New cards
2

collecting input with a prompt

VARIABLE = input(“prompt”)

New cards
3

displaying output

output VARIABLE 
output “text”
output VARIABLE, “text”, VARIABLE

New cards
4

declaring variables (general)

VARIABLE = value

New cards
5

declaring multiple variables

VARIABLE1 = value1; VARIABLE2 = value2

New cards
6

declaring variables (boolean)

boolean VARIABLE = True or False

New cards
7

declaring variables (array)

VARIABLE ARRAY

New cards
8

Arithmetic Operators

A=3+3 = 6
B=3-3 = 0
C=3*3 = 9
D=3/3 = 1
E = 3 mod 3 = 0 //remainder
F = 3 div 3 = 1 //integer solution
G = abs(C-11) // Calculate the absolute valueB

New cards
9

Boolean Operators

>

<

>=

<=

!=

=

New cards
10

if-then-else

if condition then 
//code
else if condition then
//code
else
//code
endif

New cards
11

while loops

loop while condition 
//code
endloop

New cards
12

for loops

loop counter from start to end 
//code
endloop

New cards
13

create a queue

Q = new Queue()

New cards
14

Add to end of queue

Q.enqueue(VARIABLE) 	

New cards
15

remove from start of queue

VARIABLE = Q.dequeue()	

New cards
16

check if a queue is empty

Q.isEmpty()	

New cards
17

declare a new stack

S = new Stack()	

New cards
18

Add an element to the top of stack

S.push(VARIABLE) 	

New cards
19

Remove item from top of stack

S.pop()	

New cards
20

check if stack is empty

S.isEmpty()

New cards
21

Linear Search (sequential search)

Progresses from beginning to end of array and check whether each element is equal to the target value

New cards
22

Binary search

Can only be used on a sorted algorithm. The computer checks the middle term, sees if the target value is more or less than, and then proceeds to the corresponding half to repeat the process until the target value is found or the entire designated section has been searched through.

New cards
23

Bubble Sort

Goes through an array, comparing each pair of elements, and swaps the elements if they are out of order. The process repeats until the array is fully sorted and no more swaps are made.

New cards
24

Merge Sort

A sorted and unsorted array are made. The values in the unsorted array are picked out and added to the sorted array in the order that they need to go.

New cards

Explore top notes

note Note
studied byStudied by 1210 people
688 days ago
5.0(3)
note Note
studied byStudied by 77 people
856 days ago
4.5(2)
note Note
studied byStudied by 51 people
789 days ago
5.0(1)
note Note
studied byStudied by 44 people
821 days ago
5.0(1)
note Note
studied byStudied by 12 people
760 days ago
5.0(1)
note Note
studied byStudied by 7 people
809 days ago
5.0(1)
note Note
studied byStudied by 13 people
787 days ago
5.0(1)
note Note
studied byStudied by 2899 people
686 days ago
4.8(12)

Explore top flashcards

flashcards Flashcard (42)
studied byStudied by 9 people
690 days ago
5.0(1)
flashcards Flashcard (109)
studied byStudied by 75 people
251 days ago
5.0(1)
flashcards Flashcard (58)
studied byStudied by 29 people
114 days ago
4.0(1)
flashcards Flashcard (39)
studied byStudied by 1 person
439 days ago
5.0(1)
flashcards Flashcard (20)
studied byStudied by 1 person
10 days ago
5.0(1)
flashcards Flashcard (84)
studied byStudied by 16 people
511 days ago
5.0(1)
flashcards Flashcard (43)
studied byStudied by 5 people
719 days ago
5.0(1)
flashcards Flashcard (49)
studied byStudied by 4 people
824 days ago
5.0(1)
robot