Delphi - Ready-made algorithms - Stevens R.


When studying computer science, a lot of attention is paid to the study of algorithms and their types. Without knowing basic information about them, you cannot write a program or analyze its operation. The study of algorithms begins in the school computer science course. Today we will look at the concept of an algorithm, properties of an algorithm, types.

Concept

An algorithm is a certain sequence of actions that leads to the achievement of a particular result. When compiling an algorithm, each action of the performer is prescribed in detail, which will subsequently lead him to solving the task.

Quite often, algorithms are used in mathematics to solve certain problems. Thus, many people know the algorithm for solving quadratic equations with the search for a discriminant.

Properties

Before considering them in computer science, it is necessary to clarify their basic properties.

Among the main properties of the algorithms, the following should be highlighted:

  • Determinism, that is, certainty. The point is that any algorithm assumes obtaining a certain result given the initial ones.
  • Productivity. It means that, given a number of initial data, after completing a number of steps, a certain, expected result will be achieved.
  • Mass character. An algorithm written once can be used to solve all problems of a given type.
  • Discreteness. It implies that any algorithm can be divided into several stages, each of which has its own purpose.

Recording methods

Regardless of what types of computer science algorithms you're looking at, there are several ways to write them.

  1. Verbal.
  2. Formula-verbal.
  3. Graphic.
  4. Algorithm language.

The algorithm is most often depicted as a flowchart using special designations, fixed by GOSTs.

Main types

There are three main schemes:

  1. Linear algorithm.
  2. Branching algorithm, or branched.
  3. Cyclical.

Linear

It is considered the simplest in computer science. It involves a sequence of actions. Let us give the simplest example of an algorithm of this type. Let's call it "Getting ready for school."

1. Get up when the alarm clock rings.

2. We wash ourselves.

3. Brush your teeth.

4. Do exercises.

5. Get dressed.

6. We eat.

7. We put on our shoes and go to school.

8. End of the algorithm.

Branching algorithm

When considering the types of algorithms in computer science, one cannot help but recall the branching structure. This type presupposes the existence of a condition under which, if fulfilled, actions are performed in one order, and if not fulfilled, in another.

For example, take the following situation - a pedestrian crossing the road.

1. We approach a traffic light.

2. We look at the traffic light signal.

3. It must be green (this is a condition).

4. If the condition is met, we cross the road.

4.1 If not, wait until the green light turns on.

4.2 We cross the road.

5. End of the algorithm.

Round robin algorithm

When studying the types of algorithms in computer science, you should dwell in detail on This algorithm involves a section of computation or action that is performed until a certain condition is met.

Let's take a simple example. If the series of numbers is from 1 to 100. We need to find all of them, that is, those that are divisible by one and themselves. Let's call the algorithm “Prime Numbers”.

1. Take the number 1.

2. Check if it is less than 100.

3. If yes, check whether this number is prime.

4. If the condition is met, write it down.

5. Take the number 2.

6. Check if it is less than 100.

7. Check if it is simple.

…. Let's take the number 8.

Let's check if it is less than 100.

Checking if the number is prime.

No, let's skip it.

Let's take the number 9.

In this way we go through all the numbers up to 100.

As you can see, steps 1 - 4 will be repeated a number of times.

Among cyclic ones, there are algorithms with a precondition, when the condition is checked at the beginning of the cycle, or with a postcondition, when the check occurs at the end of the cycle.

Other options

The algorithm can also be mixed. So, it can be cyclic and branched at the same time. In this case, they are used different conditions at different stages of the algorithm. Such complex structures are adopted when writing complex programs and games.

Block diagram symbols

We have looked at what types of algorithms there are in computer science. But we did not talk about what notations are used when recording them graphically.

  1. The beginning and end of the algorithm are written in an oval frame.
  2. Each command is recorded in a rectangle.
  3. The condition is written in a diamond.
  4. All parts of the algorithm are connected using arrows.

conclusions

We have discussed the topic “Algorithms, types, properties”. Computer science spends a lot of time studying algorithms. They are used when writing various programs both for solving mathematical problems and for creating games and various kinds of applications.

Delphi - Ready-made algorithms - Stevens R. - 2004.

Programming has always been quite a difficult task. This book will help you easily overcome the difficulties that arise with the help of a library of powerful algorithms, fully implemented in source code Delphi. You will learn how to choose the method most suitable for solving a specific problem, and how to achieve maximum performance your application. Typical and worst cases of implementation of algorithms are considered, which will allow you to recognize in time possible difficulties and, if necessary, rewrite or replace part of the program. The most important elements of data storage and processing algorithms (lists, stacks, queues, trees, sorting, searching, hashing, etc.) are described in detail. Not only traditional solutions are presented, but also methods based on latest achievements object-oriented programming.
The book is intended for beginner Delphi programmers, but thanks to the clear structuring of the material and a rich library of ready-made algorithms, it will also be of interest to specialists.

Introduction.
Chapter 1. Basic Concepts
What are algorithms?
Analysis of execution speed, algorithms
Memory or time.
Estimation up to order of magnitude
Definition of complexity.
Complexity of recursive algorithms
Average and worst case.
General complexity evaluation functions.
Logarithms
Speed ​​of the algorithm in real conditions
Accessing the swap file.
Summary.
Chapter 2. Lists
Basic concepts about lists.
Simple Lists.
Resizing arrays.
Variable size list
SimpleList class.
Unordered lists.
Related Lists.
Adding elements.
Removing elements.
Chapter 3. Stacks and Queues
Stacks.
Stacks on linked lists.
Queues
Cyclic queues.
Queues based on linked lists.
Priority queues
Multi-threaded queues.
Summary.
Chapter 4. Arrays
Triangular arrays
Diagonal elements
Irregular arrays
Linear representation with pointer.
Irregular linked lists.
Dynamic Delphi arrays.
Sparse arrays.
Array Indexing
Highly sparse arrays.
Summary.
Chapter 5. Recursion
What is recursion
Recursive calculation of factorials Complexity analysis
Recursive calculation
greatest common divisor
Complexity analysis.
Recursive calculation of Fibonacci numbers
Complexity analysis.
Recursive construction of Hilbert curves
Complexity analysis.
Recursive construction of Sierpinski curves.
Complexity Analysis
Disadvantages of recursion.
Infinite recursion
Memory loss
Unreasonable use of recursion.
When to use recursion.
Removing Tail Recursion
Non-recursive calculation of Fibonacci numbers.
Eliminating recursion in the general case.
Non-recursive generation of Hilbert curves.
Non-recursive construction of Sierpinski curves Summary.
Chapter 6. Trees
Definitions
Tree representations.
Full nodes
Lists of child nodes
Representation by numbering of connections.
Full trees
Tree traversal.
Ordered trees
Adding elements.
Removing elements.
Traversal of ordered trees
Trees with links
Features of the work.
Q-trees.
Changing the MAXQTREENODES value
Octal trees.
Summary.
Chapter 7. Balanced trees
Balancing.
AVL trees
Adding nodes to the AVL tree.
Removing nodes from the AVL tree.
B-trees.
B-tree performance.
Removing elements from a B-tree
Adding elements to the B-tree
Varieties of B-tree.
Improving B-trees.
Disk access issues
B+tree database
Summary.
Chapter 8. Decision trees
Search in game trees
Minimax search
Optimizing search in decision trees
Search non-standard solutions
Branches and borders.
Heuristic.
Complex tasks
The feasibility problem.
Partition problem
Hamiltonian path search problem.
Traveling salesman problem
Fire station problem.
a brief description of complex tasks
Summary
Chapter 9 Sorting
General principles.
Index tables.
Key merging and compression.
Example program
Sorting by selection
Mixing
Insertion sort
Inserting in Linked Lists
Bubble sort
Quick sort
Merge sort.
Pyramid sort.
Pyramids.
Priority queues.
Heapsort algorithm
Sorting by counting.
Block sort
Block sort using linked lists
Summary
Chapter 10. Search
Example programs
Complete search
Iterating over sorted lists.
Looping through linked lists
Binary search.
Interpolation search.
String data.
Tracking Search
Binary tracking and searching
Interpolative tracking search.
Summary.
Chapter 11. Hashing
Binding.
Advantages and Disadvantages of Bonding
Blocks.
Storing hash tables on disk.
Linking blocks.
Removing elements.
Advantages and Disadvantages of Using Open Addressing Blocks
Linear check.
Quadratic check
Pseudo-random check
Removing elements.
Summary.
Chapter 12. Network algorithms
Definitions
Network views
Node and Link Management
Network Bypass
Smallest tree frame,
Shortest way
Placement of marks.
Correction of marks
Options for finding the shortest path.
Application of algorithms for finding the shortest path.
Maximum flow
Areas of application.
Summary
Chapter 13. Object-oriented methods.
Advantages of OOP.
Encapsulation.
Polymorphism
Reuse and inheritance
OOP paradigms.
Control objects
Controlling object
Iterator.
Friendly class.
Interface
Facade
Factory.
The only object
Serialization
Paradigm Model/View/Controller Summary.
Appendix 1. Archive of examples
Contents of the archive with examples
Hardware requirements
Running sample programs
User information and support
Appendix 2. List of sample programs
Subject index

Free download e-book in a convenient format, watch and read:
Download the book Delphi - Ready-made algorithms - Stevens R. - fileskachat.com, fast and free download.

Download djvu
You can buy this book below best price at a discount with delivery throughout Russia.


Visual Basic. Ready-made algorithms- The book outlines important programming concepts that can be successfully applied to solve many practical problems. The proposed algorithms use powerful techniques such as recursion, partitioning, dynamic memory allocation, and networked data structures to help you create flexible and complex applications.
The most important concepts of the theory of algorithms and data processing (lists, stacks, queues, trees, sorting, searching, hashing, etc.) are discussed in detail.
The book contains a large number of examples that you can use in own applications either without changes at all, or by modifying them at your discretion.
It is intended primarily for experienced Visual Basic users, but thanks to the accessibility of the presentation and a rich library of ready-made algorithms, it will also be of interest to novice programmers.

Name: Visual Basic. Ready-made algorithms (+ examples)
Stevens R.
Publisher: DKM Press
Year: 2000
Pages: 377
Format: DJVU
Size: 20.3 MB
ISBN: 5-94074-001-4
Quality: Excellent
Series or Issue: For programmers

Introduction
Chapter 1. Basic Concepts
What is an algorithm
Analysis of algorithm execution speed
Resources and time
Estimation up to order of magnitude
Finding problematic parts of the algorithm
Complexity of recursive algorithms
Worst case and average case
Difficulty order evaluation functions
Logarithms
Speed ​​of the algorithm in real conditions
Accessing the swap file
Pseudopointers, object references, and collections
Summary
Chapter 2. Lists
Chapter Key Questions
Simple Lists
Collections
Variable size list
SimpleList class
Unordered Lists
Related Lists
Adding elements
Removing items
Destroying a linked list
Signal marks
Linked List Encapsulation
Cell access
Types of Linked Lists
Circular Linked Lists
Circular reference problem
Doubly linked lists
Streams
Other related structures
Pseudo pointers
Summary
Chapter 3- Stacks and Queues
Stacks
Multiple Stacks
Queues
Circular queues
Queues based on linked lists
Using Collections as Queues
Priority Queues
Multi-threaded queues
Summary
Chapter 4. Arrays
Triangular arrays
Diagonal elements
Irregular arrays
Linear representation with pointers
Irregular linked lists
Sparse Arrays
Array Indexing
Very sparse arrays
Summary
Chapter 5. Recursion
What is recursion
Recursive calculation of factorials
Recursively calculating the greatest common divisor
Analysis of program execution time
Recursive calculation of Fibonacci numbers
Analysis of program execution time
Recursive construction of Hilbert curves
Analysis of program execution time
Recursive construction of Sierpinski curves
Analysis of program execution time
Disadvantages of Recursion
Infinite recursion
Memory loss
Unreasonable use of recursion
When to use recursion
Tail recursion
Non-recursive calculation of Fibonacci numbers
Eliminating recursion in general
Non-recursive construction of Hilbert curves
Non-recursive construction of Sierpinski curves
Summary
Chapter 6. Trees
Basic terms
Tree views
Full nodes
Lists of descendants
Representation by numbering of connections
Full trees
Tree traversal
Ordered trees
Adding elements
Removing items
Traversal of ordered trees
Trees with links
Features of work
Q-trees
Changing the number of elements in a node
Using Pseudo Pointers
Octal trees
Summary
Chapter 7. Balanced Trees
Tree balance
AVL trees
Adding a node
Deleting a node
B-trees
B-tree performance
Inserting elements
Removing items
Types of B-trees
Increasing the performance of B-trees
Balancing
Issues related to accessing the disk
B+tree database
Summary
Chapter 8. Decision Trees
Search in game trees
Minimax search
Search optimization
Search for non-standard solutions
Branch and bound method
Heuristics
Complex tasks
Satisfiability problem
Partition problem
Hamiltonian path problem
Traveling salesman problem
Fire station problem
Brief description of complex problems
Summary
Chapter 9. Sorting
General principles
Index tables
Key merging and compression
Example programs
Sorting by selection
Mixing
Insertion sort
Inserting in Linked Lists
Bubble sort
Quick sort
Merge sort
Heap sort
Pyramids
Priority Queues
Heapsort algorithm
Counting sort
Block sort
Block sort using linked list
Block sort based on array
Summary
Chapter 10. Search
Example programs
Search by exhaustive search method
Search in ordered lists
Search related lists
Binary Search
Interpolation Search
String data
Tracking Search
Interpolation tracking search
Summary
Chapter 11. Hashing
Binding
Advantages and Disadvantages of Bonding
Blocks
Storing hash tables on disk
Linking blocks
Removing items
Advantages and disadvantages of using blocks
Open addressing
Linear check
Quadratic check
Pseudo-random check
Removing items
Summary
Chapter 12. Network Algorithms
Basic terms
Network views
Operating nodes and links
Network crawls
Smallest tree frame
Shortest route
Placement of marks
Correction of marks
Options for finding the shortest route
Applications that use the shortest route search method
Maximum flow
Areas of application
Summary
Chapter 13. Object-Oriented Methods
Advantages of OOP
Encapsulation
Polymorphism
Inheritance and reuse
Paradigms of OOP
Control objects
Controlling object
Iterator
Friendly class
Interface
Facade
Generating object
The only object
Serialization
Paradigm Model/View/Controller
Summary
Appendix 1. Archive with examples
Appendix 2. List of sample programs
Alphabetical index

Download Visual Basic. Ready-made algorithms (+ examples)







2024 gtavrl.ru.