• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 2 fuera de 6 páginas
Resumen

Summary GCSE OCR Computer Science revision notes for Algorithms

Document preview thumbnail
Vista previa 2 fuera de 6 páginas

These in-depth and comprehensive GCSE OCR Computer Science notes helped me to achieve a high Grade 9 in my GCSE Examinations. They were created using a wide array (pun intended) of online resources, including but not limited to Physics and Maths Tutor, Craig n Dave, ISAAC Computer Science, ZigZag Learner Companion and Teach-ICT.

Vista previa del contenido

Data set – group of data items

Two search algorithms: linear and binary

What you are looking for – search criteria

Linear search = start with he first item in the set and compare it to the search
criteria

If no match is found, then the next one is compared, continuing until a match is
found or the end of the set is reached – sequential search algorithm

Data_set = [“cat”, “dog”, “lion”, “penguin”, “ant”]


data_set_length = 5

search_criteria = "penguin"

match = false



FOR (i = 0 TO (data_set_length - 1))

IF data_set[i] == search_criteria THEN

match = true

exit loop

END IF

NEXT i



IF (match == true) THEN

PRINT "Match found"

ELSE

PRINT "No match found"

END IF

 Performs well with small and medium-sized lists

 Fairly simple to code

 The data set does not need to be in any particular order
(some algorithms need an ordered list)

,  It doesn't break if new items are inserted into the list.

Disadvantages
 May be too slow to process large lists or data sets

 If the search criteria only matches the last item in the list,
the search has to go through the entire list to find it.

Binary search algorithm must be arranged in order.

Then split into two and two again

Hover over each line to see the comment about it.



data_set = [2, 4, 5, 6, 9, 21, 50, 77, 91]

data_set_length = 9

search_criteria = 50

LB = 0

UB = data_set_length - 1

match = false



WHILE match == false AND LB != UB

MidPoint = roundup((UB - LB)/2) + LB

IF data_set[MidPoint] == search_criteria THEN

match = true

ELSE IF data_set[MidPoint] < search_criteria THEN

LB = MidPoint + 1

ELSE

UB = MidPoint - 1

END IF

END WHILE



IF match == true THEN

PRINT 'Match found'

ELSE

Información del documento

Estudio
Año escolar
3
Subido en
2 de septiembre de 2026
Número de páginas
6
Escrito en
2023/2024
Tipo
Resumen
$14.40

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Vendido
0
Seguidores
0
Artículos
29
Última venta
-




Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes