Algorithms - Basic

Elementary Data Structures Abstract Data Types Java provides many abstract data types, for example in the java.util package. This exam does not refer to the built-in collections, but to your own classes. Recursion
  • Define recursion (note: to define recursion, you first need to define recursion - Anonymous)
  • Identify obvious cases of false recursion (that could be implemented with a loop and no stack).
  • Detect incorrect stop conditions that create never ending recursion.
  • Implement recursion for solving problems.
    For example:
    • Compute a factorial
    • Euclid: find the greatest common divisor
    • Evaluate a prefix expression (simple example of recursive descent parser). e.g. +2,3 (which equals 5).
    • Find the greatest number of an array (false recursion)
    • Move towers of Hanoi.
    • Binary search in an ordered array.
Trees
  • Define:
    • node, child/parent node, root, leaf,
    • path, height,
    • binary tree, ordered tree.
  • Implement a tree representation
  • Write an algorithm that:
    • Traverses a binary tree: preorder, inorder, postorder,
    • computes the height or the amount of nodes of a tree,
    • finds an element in a binary search tree,
    • constructs a tournament tree (from an array).
Sorting
  • Define a stable sort.
  • Identify and implement:
    • Selection sort.
    • Insertion sort.
Note: Java provides sorting algorithms, for example in the java.util package. This exam does not refer to these built-in algorithms, and require no knowledge about interfaces as Comparable.

你可能感兴趣的:(java)