Informatik (Fach) / DAP1 (Lektion)
In dieser Lektion befinden sich 33 Karteikarten
Datenstrukturen, Algorithmen und Programmierung 1
Diese Lektion wurde von checko erstellt.
Diese Lektion ist leider nicht zum lernen freigegeben.
- Sortiere die nachstehenden Zahlen in dieser Reihenfolge ... 41 -r-> 59 -l-> 47 -l-> 23 -r-> 29 -r-> 31 23 -l-> 15 -r-> 22
- Sortiere die nachstehenden Zahlen in dieser Reihenfolge ... 22 -r-> 27 -r-> 32 -r-> 62 32 -l-> 31 27 -l-> 25 22 -l-> 15
- Konstruiere einen Moore-Automaten, der in einer Folge ... Zust. 0: a -> 1, b -> 0, sonst -> 0 Zust. 1: a -> 2, b -> 0, sonst -> 0 Zust. 2: a -> 2, b -> 3, sonst -> 0 Zust. 3: a -> 4, b -> 0, sonst -> 0 Zust. 4: a -> 2, b -> 5, sonst -> 0 Zust. 5: a -> 6, b -> ...
- Konstruiere einen Moore-Automaten, der in einer Folge ... Zust. 0: x -> 1, y -> 0, z -> 0, sonst -> 0 Zust. 1: x -> 1, y -> 2, z -> 0, sonst -> 0 Zust. 2: x -> 1, y -> 0, z -> 3, sonst -> 0 Zust. 3: x -> 4, y -> 0, z -> 0, sonst -> 0 Zust. 4: x -> 1, y -> 5, ...
- Bestimme die Codierung der nachstehenden Zeichen mit ... a: 11010, b: 11011, c: 1100, d: 111, e: 00, f: 01, g: 10
- Bestimme die Codierung der nachstehenden Zeichen mit ... a: 00, b: 010, c: 0110, d: 0111, e: 1
- Polymorphie: Lösen der Aufgabe 3 (Klausur vom 21.1.13) ... Y Y L L E L M D
- Schreibe die Klasse box, die einen Quader beschreibt. ... public double getVolumeSize() { return width * height * depth; } public double getAreaSize() { return 2 * (width * height + width * depth + height * depth); } public double getEdgesLength() { return 4 ...
- Schreibe die Klasse box, die einen Quader beschreibt. ... public boolean isCube() { return (width == height) && (width == depth); }
- Schreibe die Klasse box, die einen Quader beschreibt. ... public int compareTo(Box f) { double v1 = getVolumeSize(); double v2 = f.getVolumeSize(); if (v1 > v2) { return 1; } else if (v1 == v2) { return 0; } else { return -1; ...
- Schreibe die Klasse box, die einen Quader beschreibt. ... public boolean encloses(Box f) { // teste alle moeglichen Kombinationenreturn (width >= f.width && height >= f.height && depth >= f.depth) || (width >= f.width && height >= f.depth && depth >= f.height) ...
- Implementieren eine Methode, die die Quersumme einer ... public static int digitSum( int y ) { int x = abs(y); int sum = 0; while (x > 0) { sum = sum + x%10; x = x/10; } return sum; }
- Implementieren eine Methode, die die Quersumme einer ... public static int digitSum( int n ) { n = Math.abs(n); if (n < 10) { return n; } else { return n%10 + digitSum(n/10); } }
- Implementieren eine Methode, die prüft, ob die drei ... public static boolean isPythaTriple( int a, int b, int c ) { int aSquare = a*a; int bSquare = b*b; int cSquare = c*c; return (aSquare + bSquare == cSquare || (aSquare + cSquare == bSquare) ...
- Implementiere eine Methode, die die nte harmonische ... public static double harm( int n ) { if (n < 1) throw new RuntimeException(); if (n == 1) return 1.0; else return 1.0/n + harm(n-1); }
- Implementiere eine Methode, die die nte harmonische ... public static double harm( int n ) { if (n < 1) {throw new RuntimeException()}; if (n == 1) { int sum = 0; for (int i = 0; i <= n; i++) { sum = sum + 1/i; } return sum; ...
- Implementiere eine Methode, die den Binärcode eines ... public static String binaryCode(int i) { if (i < 0) throw new RuntimeException(); if (i < 2) { return ""+ i; } else { return binaryCode(i/2) + i%2; } }
- Entwickele eine Methode "int maximum( int[] arr, int ... public static int maximum(int[] arr, int i) { if (i<0 || i>=arr.length) { throw new RuntimeException(); } if (i == 0) { return arr[0]; } else { int max = maximum(arr, ...
- Entwickele eine Methode "int maximum( int[] arr, int ... public static int maximum( int[] arr ) { if (arr.length == 0) { return 0; } int max = arr[0]; for (int number : arr) { if (max < number) { max = number; ...
- Implementiere eine Methode "checkArray", die überprüft, ... public static boolean checkArray(int[] f) { if (f.length == 0) {return false}; int i = 0; int n = f.length-1; while ( i < n ) { if (f[i] != f[n]) return false; i++; n--; ...
- Implementiere eine Methode "checkArray", die überprüft, ... public static boolean checkArray(int[] arr, int i) { if (i<0 || i>arr.length-1) { return false;} else { int j=arr.length-1-i; /* rechter Index */ if (i > j) { ...
- Welche drei Möglichkeiten gibt es einen binären ... PreOrder: Wurzel-links-rechts (10, 5, 2, 7, 15, 12, 20) InOrder: links-Wurzel-rechts (2, 5, 7, 10, 12, 15, 20) PostOrder: links-rechts-Wurzel (2, 7, 5, 12, 20, 15, 10)
- Implementiere die Methode "showPreOrder", die die ... public void showPreorder() { if ( !isEmpty() ) { if ( isLeaf() ) { System.out.print( '*' ); } System.out.println( content.toString() ); leftChild.showPreorder(); ...
- Implementiere eine Methode "containsCharacter", die ... public boolean containsCharacter( char t ) { if ( !isEmpty() ) { if ( content.getToken() > t ) { return leftChild.containsCharacter( t ); } else if ( content.getToken() ...
- Implementiere eine Methode "equalStructure", die einen ... public boolean equalStructure( CharacterSearchTree cst ) { if ( isEmpty() ) { return cst.isEmpty(); } else if ( cst.isEmpty() ) { return false; } else { return leftChild.equalStructure( ...
- Implementiere die Methode "contains( Object o )", ... public boolean contains( Object o ) { Element current = first; while ( current != null ) { if ( ( o == null && current.getContent() == null ) || ...
- Implementiere die Methode "count( Object o )", welche ... public int count( Object o ) { int tally = 0; Element current = first; while ( current != null ) { if ( ( o == null && current.getContent() == null ) || ( o != null ...
- Implementiere die Methode "insert( int n, Object o ... public void insert( int n, Object o ) { Element pre = elementAt( n ); Element suc = pre.getNext(); Element elm = new Element( o ); pre.connectAsNext( elm ); if ( suc == null ) { ...
- Implementiere die Methode "remove( Object o )" soll ... public void remove( Object o ) { Element candidate = first; Element nextCandidate; while ( candidate != null ) { nextCandidate = candidate.getNext(); if ( ( o == null && candidate.getContent() ...
- Welche drei Strategie-Klassen sind aus der Vorlesung ... a) SubstitutingStrategy; Methode: subsitute; Verhalten: Ersetzt den Inhalt eines Objekte durch einen Anderen. b) TraversingStrategy; Methode: inspect; Verhalten: Benutzt den Inhalt eines Objektes für ...
- Implementiere die Strategie "DoubleAllInIntervalStrategy", ... public class DoubleAllInIntervalStrategy extends DoublyLinkedList.SubstitutingStrategy<Integer> { private int lowerBound, upperBound; public DoubleAllInIntervalStrategy( int low, int up ) { ...
- Implementiere die Strategie "CountInIntervalStrategy", ... public class CountInIntervalStrategy extends DoublyLinkedList.TraversingStrategy<Integer> { private int lowerBound, upperBound; private int quantity; public CountInIntervalStrategy( int low, ...
- Implementiere die Strategie "RemoveAndCountAllInIntervalStrategy", ... public class RemoveAndCountAllInIntervalStrategy extends DoublyLinkedList.FilteringStrategy<Integer> { private int lowerBound, upperBound; private int quantity; public RemoveAndCountAllInIntervalStrategy( ...