Skip to main content

AI Agents: What They Are and How They Will Change Work

Artificial intelligence has moved beyond simply answering questions and generating text. A new generation of AI systems—known as AI agents—is emerging with the ability to plan tasks, use tools, make decisions, and complete multi-step workflows with less human intervention. From managing emails and analyzing data to writing software and assisting customers, AI agents could significantly change how people work. What Are AI Agents? An AI agent is a software system that can perceive information, reason about a goal, take actions, and adapt based on the results. Traditional AI tools usually respond to a specific instruction. For example, you might ask an AI chatbot to summarize a document, and it provides a summary. An AI agent can go further. You could give an agent a goal such as: "Research three competitors, compare their pricing, summarize their main features, and prepare a report." The agent may then: 1) Understand the objective. 2) Break the task into smaller steps. 3) Searc...

Classification of data structures

CLASSIFICATION OF DATA STRUCTURES
Data structures are generally categorized into two classes: primitive and non-primitive data structures. 
Primitive and Non-primitive Data Structures
Primitive data structures are the fundamental data types which are supported by a programming language. Some basic data types are integer, real, character, and boolean. The terms ‘data type’, ‘basic data type’, and ‘primitive data type’ are often used interchangeably. 
Non-primitive data structures are those data structures which are created using primitive data structures. Examples of such data structures include linked lists, stacks, trees, and graphs. 
Non-primitive data structures can further be classified into two categories: linear and non-lineardata structures. 
Linear and Non-linear Structures
If the elements of a data structure are stored in a linear or sequential order, then it is a linear data structure. Examples include arrays, linked lists, stacks, and queues. Linear data structures can be 
represented in memory in two different ways. One way is to have to a linear relationship between elements by means of sequential memory locations. The other way is to have a linear relationship 
between elements by means of links.
However, if the elements of a data structure are not stored in a sequential order, then it is a non-linear data structure. The relationship of adjacency is not maintained between elements of a 
non-linear data structure. Examples include trees and graphs. 
C supports a variety of data structures. We will now introduce all these data structures and they would be discussed in detail in subsequent chapters. 

Arrays
An array is a collection of similar data elements. These data elements have the same data type. The elements of the array are stored in consecutive memory locations and are referenced by an index (also known as the subscript).
In C, arrays are declared using the following syntax:
type name[size];
For example,
int marks[10];
The above statement declares an array marks that contains 10 elements. In C, the array index starts from zero. This means that the array marks will contain 10 elements in all. The first element will 
be stored in marks[0], second element in marks[1], so on and so forth. Therefore, the last element, that is the 10th element, will be stored in marks[9]. In the memory, the array will be stored 
Fig:  Memory representation of an array of 10 elements
Arrays are generally used when we want to store large amount of similar type of data. But they have the following limitations:
* Arrays are of fixed size.
* Data elements are stored in contiguous memory locations which may not be always available.
* Insertion and deletion of elements can be problematic because of shifting of elements from their positions.
However, these limitations can be solved by using linked lists.

Linked Lists
A linked list is a very flexible, dynamic data structure in which elements (called nodes) form a sequential list. In contrast to static arrays, a programmer need not worry about how many elements will be stored in the linked list. This feature enables the programmers to write robust programs 
which require less maintenance.
In a linked list, each node is allocated space as it is added to the list. Every node in the list points to the next node in the list. Therefore, in a linked list, every node contains the following two types of data:
* The value of the node or any other data that corresponds to that node
* A pointer or link to the next node in the list
The last node in the list contains a NULL pointer to indicate that it is the end or tail of the list. Since the memory for a node is dynamically allocated when it is added to the list, the total number of nodes that may be added to a list is limited only by the amount of memory available.
               Fig : Simple linked list

Stacks
A stack is a linear data structure in which insertion and deletion of elements are done at only one end, which is known as the top of the stack. Stack is called a last-in, first-out (LIFO) structure because the last element which is added to the stack is the first element which is deleted from the stack.
In the computer’s memory, stacks can be implemented using arrays or linked lists.The below figshows the array implementation of a stack. 
Fig : Array representation of a stack
Every stack has a variable top associated with it. top is used to store the address of the topmost element of the stack. It is this position from where the element will be added or deleted. There is another variable MAX, which is used to store the maximum number of elements that the stack can store.
If top = NULL, then it indicates that the stack is empty and if top = MAX–1, then the stack is full.
top = 4, so insertions and deletions will be done at this position. Here, the stack 
can store a maximum of 10 elements where the indices range from 0–9. In the above stack, five more elements can still be stored.
A stack supports three basic operations: push, pop, and peep. The push operation adds an element to the top of the stack. The pop operation removes the element from the top of the stack. And the peep operation returns the value of the topmost element of the stack (without deleting it).
However, before inserting an element in the stack, we must check for overflow conditions. An overflow occurs when we try to insert an element into a stack that is already full.
Similarly, before deleting an element from the stack, we must check for underflow conditions. An underflow condition occurs when we try to delete an element from a stack that is already empty.

Queues
A queue is a first-in, first-out (FIFO) data structure in which the element that is inserted first is the first one to be taken out. The elements in a queue are added at one end called the rear and removed from the other end called the front. Like stacks, queues can be implemented by using 
either arrays or linked lists.
Every queue has front and rear variables that point to the position from where deletions and insertions can be done, respectively. 
Fig : Array representation of a queue
Here, front = 0 and rear = 5. If we want to add one more value to the list, say, if we want to add another element with the value 45, then the rear would be incremented by 1 and the value would be stored at the position pointed by the rear. The queue, after the addition, would be as 
shown in below figure.
Fig : Queue after insertion of a new element
Here, front = 0 and rear = 6. Every time a new element is to be added, we will repeat the same procedure
Now, if we want to delete an element from the queue, then the value of front will be incremented. Deletions are done only from this end of the queue. The queue after the deletion will be as shown in below figure.
Fig: Queue after deletion of an element
However, before inserting an element in the queue, we must check for overflow conditions. An overflow occurs when we try to insert an element into a queue that is already full. A queue is full when rear = MAX–1, where MAX is the size of the queue, that is MAX specifies the maximum number of elements in the queue. Note that we have written MAX–1 because the index starts from 0.
Similarly, before deleting an element from the queue, we must check for underflow conditions. An underflow condition occurs when we try to delete an element from a queue that is already empty. If front = NULL and rear = NULL, then there is no element in the queue. 

Trees
A tree is a non-linear data structure which consists of a collection of nodes arranged in a hierarchical order. One of the nodes is designated as the root node, and the remaining nodes can be partitioned 
into disjoint sets such that each set is a sub-tree of the root.
The simplest form of a tree is a binary tree. A binary tree consists of a root node and left and right sub-trees, where both sub-trees are also binary trees. Each node contains a data element, a left pointer which points to the left sub-tree, and a right pointer which points to the right sub-tree. The root element is the topmost node which is pointed by a ‘root’ pointer. If root = NULL then the tree is empty.
Below figure shows a binary tree, 
                  Fig : Binary tree
where R is the root node and T1 and T2 are the left and right sub-trees of R. If T1 is non-empty, then T1 is said to be the left successor of R. Likewise, if T2is non-empty, then it is called the right successor of R.node 2 is the left child and node 3 is the right child of the root node 1. Note that the left sub-tree of the root node consists of the nodes 2, 4, 5, 8, and 9. Similarly, the right sub-tree of the root node consists of 
the nodes 3, 6, 7, 10, 11, and 12.

Graphs
A graph is a non-linear data structure which is a collection of vertices (also 
called nodes) and edges that connect these vertices. A graph is often viewed 
as a generalization of the tree structure, where instead of a purely parent-to-child relationship between tree nodes, any kind of complex relationships between the nodes can exist.
               Fig : Graph
In a tree structure, nodes can have any number of children but only one parent, a graph on the other hand relaxes all such kinds of restrictions. Figure shows a graph with five nodes.
A node in the graph may represent a city and the edges connecting the nodes can represent roads. 
A graph can also be used to represent a computer network where the nodes are workstations and the edges are the network connections. Graphs have so many applications in computer science and mathematics that several algorithms have been written to perform the standard graph operations, such as searching the graph and finding the shortest path between the nodes of a graph.
Note that unlike trees, graphs do not have any root node. Rather, every node 
in the graph can be connected with every another node in the graph. When two 
nodes are connected via an edge, the two nodes are known as neighbours. For 
example, in Fig. , node A has two neighbours: B and D.

Popular posts from this blog

Deadlock Characterisation

Deadlock Characterization Necessary Conditions: There are four conditions that are required to achieve deadlock: Mutual Exclusion  - At least one resource must be grip in a non-sharable mode; If any other process requests this resource, then that process must wait for the resource to be released. Hold and Wait  - A process must be concurrently gripping at least one resource and waiting for at least one resource that is presently being grip by some other process. No preemption  - Once a process is belonging a resource ( i.e. once its request has been allowed ), then that resource not be taken away from that process until the process freely releases it. Circular Wait -  A group of processes { P0, P1, P2, . . ., PN } must exist such that every P[ i ] is waiting for P[ ( i + 1 ) % ( N + 1 ) ]. ( Note that this situation implied the hold-and-wait condition, but it is easier to deal with the conditions if the four are considered individually. ) Resource-Allocation Graph In...

FIRM

          A firm is an organisation which converts inputs into outputs and it sells. Input includes the factors of production (FOP). Such as land, labour, capital and organisation. The output of the firm consists of goods and services they produce.           The firm's are also classified into categories like private sector firms, public sector firms, joint sector firms and not for profit firms. Group of firms include Universities, public libraries, hospitals, museums, churches, voluntary organisations, labour unions, professional societies etc. Firm's Objectives:            The objectives of the firm includes the following 1. Profit Maximization:           The traditional theory of firms objective is to maximize the amount of shortrun profits. The public and business community define profit as an accounting concept, it is the difference between total receipts and total profit. 2. Fi...

LIGHT

Rectilinear Propagation, Shadows and Eclipse :  * Light travels in straight line.  * The kind of shadow depends on the size     of the source of light  * Shadow obtained is a region of total       darkness called umbra  * Shadow obtained partial darkness called penumbra.  * Lunar eclipse - earth comes between the sun and the moon.  * Solar eclipse - moon comes between the sun and the earth.  Reflection of light  * A highly smoothed surface, such as a mirror, reflects most of the light falling on it.   (i) The angle of incidence is equal to  the        angle of reflection, and   (ii) The incident ray, the normal to the       mirror at the point of incidence and the   reflected ray, all lie in the same plane.  An image formed in a plane mirror has the following Characteristics.  * The image is of the equal size as the object. ...