### Register For Course

 HawksCode Softwares Pvt. Ltd Course Number: ES 236
HawksCode Softwares Pvt. Ltd
COURSE DETAIL

In computer science, a data structure is a particular way of organizing data in a computer so that it can be used efficiently.

Different kinds of data structures are suited to different kinds of applications, and some are highly specialized to specific tasks. For example, databases use B-tree indexes for small percentages of data retrieval and compilers and databases use dynamic hash tables as look up tables.

Data structures provide a means to manage large amounts of data efficiently for uses such as large databases and internet indexing services. Usually, efficient data structures are key to designing efficient algorithms. Some formal design methods and programming languages emphasize data structures, rather than algorithms, as the key organizing factor in software design. Storing and retrieving can be carried out on data stored in both main memory and in secondary memory.

The Automatic Programming Server produces versions of generic procedures that are specialized for your data structures. This document tells how to describe your data structures to the system.

When you start the Automatic Programming Server, it creates a window containing an input area and a command menu. Click the mouse in the input area, then enter the description of your data; the input editor is an Emacs subset. After the description of your data structure is complete, click the mouse outside the input area; the system will respond with a confirming message. Repeat the process as needed to define other data types.

A parenthesized, Lisp-like data description language is used for all of these languages. The system will generate appropriate declarations in the target language for use if desired.

If the desired type is a basic type, only the basic type name needs to be specified. The basic types are:

• integer
• real
• string
• boolean
• anything

If a view such as avl-tree is selected when the user type is a basic type, the system will define an appropriate carrier record containing that type as its contents.

A record is described by the form: (name   fields) where a field is (name   type) . A pointer to a type is denoted (^     type)

An example data declaration for a person data structure that could be viewed as a linked list is:

(person (name   string)

(age    integer)

(salary real)

(friend (^ person)))

Data Descriptions for Lisp

A Lisp data description has the basic form: (name   type)

A type is either a type name or a structuring operator applied to types. The basic types are:

integer

real

number (any number type in Lisp)

string

symbol

boolean

anything

The structuring operators are:

(cons type1   type2 )

(list type1   ...   typen)

(symbol (proplist prop1   ...   propn)) where each propi is ( name   type )

(^   type) (pointer to a named type)

(listof type)

(arrayof type)

An example data declaration for a person data structure in Lisp is:

(person (list (name   string) (age    integer) (salary real)