100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4.2 TrustPilot
logo-home
Resumen

Samenvatting Algorithms & Data Structures ()

Puntuación
3.0
(1)
Vendido
2
Páginas
28
Subido en
01-06-2020
Escrito en
2019/2020

Summary for the Algorithms and Data Structures Course of the HBO-ICT programme at Hanze University of Applied Sciences. Contains a combination of chapters 18 to 29 of the book “Introduction to Java Programming and Data Structures (11th)” written by Y. Daniel Liang, and notes that were taken during lectures given by Bas Heijne and Bart Barnard in the HBO-ICT Programme (). Summary written by Willem Meijer. #### Samenvatting voor het vak Algoritmes en Data Structuren voor de opleiding HBO-ICT aan de Hanze Hogeschool. Bevat een combinatie van de hoofdstukken 18 tot en met 29 uit het boek "Introduction to Java Programming and Data Structures (11th)" geschreven door Y. Daniel Liang, and aantekeningen van de hoorcolleges gegeven door Bas Heijne en Bart Barnard in het HBO-ICT programma (). Samenvatting geschreven door Willem Meijer.

Mostrar más Leer menos
Institución
Grado










Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Libro relacionado

Escuela, estudio y materia

Institución
Estudio
Grado

Información del documento

¿Un libro?
No
¿Qué capítulos están resumidos?
H18 - h29
Subido en
1 de junio de 2020
Número de páginas
28
Escrito en
2019/2020
Tipo
Resumen

Temas

Vista previa del contenido

Meijer, W. Summary Algorithms and Data Structures (2019-2020). Hanze University of Applied
Sciences.




Summary for the Algorithms and Data Structures Course of the HBO-ICT programme at Hanze
University of Applied Sciences.

Contains a combination of chapters 18 to 29 of the book “Introduction to Java Programming and
Data Structures (11th)” written by Y. Daniel Liang, and notes that were taken during lectures given by
Bas Heijne and Bart Barnard in the HBO-ICT Programme (2019-2020).

Summary written by Willem Meijer.




1

,Meijer, W. Summary Algorithms and Data Structures (2019-2020). Hanze University of Applied
Sciences.

Chapter 18: Recursion
Recursive Methods: methods tat invoke themselves. Divides one larger problem into multiple
subproblems. Knows how to deal with the simplest possible problem, base case or stopping condition.
int factorial (int n) {
if (n == 1) {
return n;
}
return n * factorial(n - 1);
}

In the example above a factorial is calculated by calculating a smaller factorial until its base case (n =
1) is reached.

Direct Recursion: the method invokes itself.
Indirect Recursion: a method invokes another method, which in turn calls this method.

Every recursive method has three characteristics:
• Has an if-else or switch statement that results in different cases.
• Has one or more base cases.
• Reduces the original problem into one or more smaller ones.
Recursive Helper Method: a method that is not used by the user, but called by the method that is.
Generally has additional parameters.
public boolean isPalindrome(String s) {
return isPalindrome(0, s.length - 1, s);
}

private Boolean isPalindrome(int low, int high, String s) {
if (high <= low) {
return true;
}
else if (s[low] != s[high]) {
return false;
}
else {
return isPalindrome(low++, high++, s);
}
}

The private method isPalindrome is the helper method of the public one.

Compared with iterating (using a loop), recursion has substantial overhead, as the system allocates
new resources every method call. However, there is not necessarily over either one as recursive
methods can very effectively solve problems.

Tail Recursion: calling the recursive method at the end of the method.
Auxiliary Parameters: parameters that contain the most up-to-date result.




2

, Meijer, W. Summary Algorithms and Data Structures (2019-2020). Hanze University of Applied
Sciences.

Chapter 19: Generics
Using Generics allows you to parameterize object types, allowing you to create functionalities (e.g.
lists) once, and use these for any type of object, reducing your workload and redundant code. In Java,
you can pass Type parameters using <>. This can both be done when instantiating a new object, or
when calling a specific function. When doing the former, this means all methods where generics are
used have to be of that specific type.
public class ObjectA<E> {
E element;
public ObjectA(E element) {
this.element = element;
}

public static <T implements Comparable> T getGreater(T e1, T e2) {
return e1.CompareTo(e2) == 1 ? e1: e2;
}
}

A class that uses a generic in two occasions When defining the object, a type can be parameterized
for the entire class (in code the type is substituted with E). A separate object can be parameterized
when calling getGreater() too (in code the type is substituted with T). generics can be required to
extend or implement specific classes (such as Comparable for T in the example). Such a generic is
called a bounded generic.

When no type is inserted to define the generic, we speak of a raw type. For getGreater() T would
default to Comparable, whereas in ObjectA E would default to Object. A wildcard is a version of
generics where no type needs to be defined when using that generic. In code, its type is substituted
with a question mark. Wildcards can be bounded as well.

Type Erasure: To make generics backwards compatible, the generic types are removed and all
implementations reverted to their most basic case during compilation (so for E Object, and T
Comparable). Therefore, type information is no longer available during runtime.




3
$8.98
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada

Reseñas de compradores verificados

Se muestran los comentarios
4 año hace

3.0

1 reseñas

5
0
4
0
3
1
2
0
1
0
Reseñas confiables sobre Stuvia

Todas las reseñas las realizan usuarios reales de Stuvia después de compras verificadas.

Conoce al vendedor

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
willem88836 Rijksuniversiteit Groningen
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
33
Miembro desde
7 año
Número de seguidores
32
Documentos
5
Última venta
2 año hace

3.0

5 reseñas

5
0
4
2
3
2
2
0
1
1

Recientemente visto por ti

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