The document discusses lists and linked lists. It begins by describing lists and their implementations using arrays and linked lists. It then focuses on linked list implementations, describing linear linked lists and their representation, operations like traversal, search, insert, and delete. Doubly linked lists are also covered, along with their representation and similar operations. The document provides detailed code examples for many of the linked list operations.
The document discusses list data structures and their implementation using arrays and linked memory. It describes common list operations like insertion, removal, searching, and provides examples of how to implement them with arrays and linked lists. Key list operations include adding and removing elements from different positions, accessing elements by index or pointer, and traversing the list forward and backward. Linked lists offer more flexibility than arrays by not requiring predefined memory allocation.
This document provides information on circular linked lists including:
- Circular linked lists have the last element point to the first element, allowing traversal of the list to repeat indefinitely.
- Both singly and doubly linked lists can be made circular. Circular lists are useful for applications that require repeated traversal.
- Types of circular lists include singly circular (one link between nodes) and doubly circular (two links between nodes).
- Operations like insertion, deletion, and display can be performed on circular lists similarly to linear lists with some adjustments for the circular nature.
In computer science, a linked list is a linear collection of data elements, in which linear order is not given by their physical placement in memory. Instead, each element points to the next
Here are the key steps to insert a new node into a linked list:
1. Check for available memory (node)
2. Create the new node and set its data
3. If inserting at head, update head pointer; else insert after the given node by updating next pointers.
4. Return
A list is a sequential data structure that allows additions and removals at any position, unlike stacks and queues. Common list operations include adding and removing nodes, updating node contents, checking if the list is empty/full, and initializing/destroying the list. Lists can be implemented using arrays (for static storage) or linked nodes (for dynamic storage). Array lists allow constant-time access but linear-time insertion/removal. Linked lists have linear-time access but constant-time insertion/removal. Both use probes and previous references to traverse the list during operations.
The document discusses linked lists, including their definition as a dynamic linear data structure composed of connected nodes where each node contains a data element and a pointer, common operations on linked lists such as traversal, insertion, and deletion, and variations like single vs. double linked lists and circular lists. Algorithms for searching, inserting, and deleting nodes from a singly linked list are presented along with advantages of linked lists over arrays for dynamic data structures.
Linked lists are linear data structures where elements are linked using pointers. The three main types are singly, doubly, and circular linked lists. Linked lists allow dynamic memory allocation and fast insertion/deletion compared to arrays but slower access. A linked list contains nodes, each with a data field and pointer to the next node. Basic operations on linked lists include insertion, deletion, traversal, and search. Doubly linked lists include pointers to both the next and previous nodes.
The document discusses list data structures and their implementation using arrays and linked memory. It describes common list operations like insertion, removal, searching, and provides examples of how to implement them with arrays and linked lists. Key list operations include adding and removing elements from different positions, accessing elements by index or pointer, and traversing the list forward and backward. Linked lists offer more flexibility than arrays by not requiring predefined memory allocation.
This document provides information on circular linked lists including:
- Circular linked lists have the last element point to the first element, allowing traversal of the list to repeat indefinitely.
- Both singly and doubly linked lists can be made circular. Circular lists are useful for applications that require repeated traversal.
- Types of circular lists include singly circular (one link between nodes) and doubly circular (two links between nodes).
- Operations like insertion, deletion, and display can be performed on circular lists similarly to linear lists with some adjustments for the circular nature.
In computer science, a linked list is a linear collection of data elements, in which linear order is not given by their physical placement in memory. Instead, each element points to the next
Here are the key steps to insert a new node into a linked list:
1. Check for available memory (node)
2. Create the new node and set its data
3. If inserting at head, update head pointer; else insert after the given node by updating next pointers.
4. Return
A list is a sequential data structure that allows additions and removals at any position, unlike stacks and queues. Common list operations include adding and removing nodes, updating node contents, checking if the list is empty/full, and initializing/destroying the list. Lists can be implemented using arrays (for static storage) or linked nodes (for dynamic storage). Array lists allow constant-time access but linear-time insertion/removal. Linked lists have linear-time access but constant-time insertion/removal. Both use probes and previous references to traverse the list during operations.
The document discusses linked lists, including their definition as a dynamic linear data structure composed of connected nodes where each node contains a data element and a pointer, common operations on linked lists such as traversal, insertion, and deletion, and variations like single vs. double linked lists and circular lists. Algorithms for searching, inserting, and deleting nodes from a singly linked list are presented along with advantages of linked lists over arrays for dynamic data structures.
Linked lists are linear data structures where elements are linked using pointers. The three main types are singly, doubly, and circular linked lists. Linked lists allow dynamic memory allocation and fast insertion/deletion compared to arrays but slower access. A linked list contains nodes, each with a data field and pointer to the next node. Basic operations on linked lists include insertion, deletion, traversal, and search. Doubly linked lists include pointers to both the next and previous nodes.
Array implementation and linked list as datat structureTushar Aneyrao
The document discusses arrays and linked lists. It defines arrays as collections of elements of the same data type stored in contiguous memory. Linked lists store elements in memory locations that are not contiguous. Each element of a linked list contains a data field and a pointer to the next node. This allows for efficient insertion and deletion of nodes compared to arrays. The document provides examples of implementing common linked list operations like insertion at the head, tail, and deletion.
The document discusses sorting algorithms, abstract data types (ADTs), and linked lists. It describes selection sort and insertion sort algorithms for sorting arrays. It then explains that linked lists are a more flexible data structure than arrays and defines a singly linked list as an ADT with nodes that point to the next node in the list. Functions for typical linked list operations like insertion, deletion, checking if empty, and printing the list are discussed.
Bca data structures linked list mrs.sowmya jyothiSowmya Jyothi
1. Linked lists are a linear data structure where each element contains a data field and a pointer to the next element. This allows flexible insertion and deletion compared to arrays.
2. Each node of a singly linked list contains a data field and a next pointer. Traversal follows the next pointers from head to tail. Doubly linked lists add a back pointer for bidirectional traversal.
3. Common operations on linked lists include traversal, search, insertion at head/specific point, and deletion by adjusting pointers. Memory for new nodes comes from a free list, and deleted nodes return there.
1) Linked lists are a data structure that store elements in individual nodes that are connected to each other using pointers. This allows for dynamic memory allocation as opposed to static allocation in arrays.
2) The basic operations on linked lists include creation, insertion, deletion, traversal, searching, concatenation, and displaying the list. Insertion and deletion can be done at the beginning, middle, or end of the list.
3) Linked lists are useful for applications that require dynamic memory allocation, like stacks, queues, and storing objects that may vary in number, such as images to burn to a CD.
This document discusses different types of linked lists including header linked lists, circular header linked lists, grounded header linked lists, two-way linked lists, and provides algorithms for traversing, searching, inserting, and deleting nodes from circular header and two-way linked lists. Header linked lists contain a special header node and can be circular or grounded. Circular header linked lists have the last node point to the header node, while grounded lists have the last node point to null. Two-way lists contain forward and backward pointers to traverse in both directions. Algorithms for traversing, searching, and modifying nodes in circular header and two-way lists are presented.
The document discusses linked lists as an alternative to arrays for storing data. It provides 3 key points:
1. Linked lists store data in nodes that are linked together using pointers, rather than in a fixed contiguous block of memory like arrays. Each node contains a data field and a pointer to the next node.
2. Common linked list operations like insertion, deletion, and searching have time complexities of O(1) or O(n) depending on the position in the list, which can be more efficient than arrays that require shifting elements.
3. The document presents a simple C++ implementation of a linked list using Node and List classes to demonstrate how to implement basic linked list functions like insertion, deletion
The document discusses different types of linked lists including singly linked lists, doubly linked lists, and circularly linked lists. Singly linked lists contain nodes that point to the next node in the list, while doubly linked lists contain nodes that point to both the next and previous nodes. Circularly linked lists form a circle with the last node pointing back to the first node. The document provides code examples for common linked list operations like insertion, removal and traversal for each of the linked list types.
In computer science, a linked list is a linear collection of data elements, whose order is not given by their physical placement in memory. Instead, each element points to the next. It is a data structure consisting of a collection of nodes which together represent a sequence.
A data structure is a way of storing data in computer memory so that it can be retrieved and manipulated efficiently. There are two main categories of data structures: linear and non-linear. Linear data structures include arrays, stacks, and queues where elements are stored in a linear order. Non-linear structures include trees and graphs where elements are not necessarily in a linear order. Common operations on data structures include traversing, searching, insertion, deletion, sorting, and merging. Algorithms use data structures to process and solve problems in an efficient manner.
This document discusses linked lists, their types, operations, and applications. It covers:
- Linked lists are dynamic data structures that allow elements to be added or removed easily. They consist of nodes that point to the next node.
- The main types are single linked lists, doubly linked lists, and circular linked lists. Doubly linked lists allow traversal in both directions.
- Basic linked list operations include initialization, adding elements, traversing nodes, and removing elements.
- Linked lists can be used to implement stacks, queues, and priority queues. They are also useful for simulation models using events.
a. Concept and Definition✓
b. Inserting and Deleting nodes ✓
c. Linked implementation of a stack (PUSH/POP) ✓
d. Linked implementation of a queue (Insert/Remove) ✓
e. Circular List
• Stack as a circular list (PUSH/POP) ✓
• Queue as a circular list (Insert/Remove) ✓
f. Doubly Linked List (Insert/Remove) ✓
For more course related material:
https://github.com/ashim888/dataStructureAndAlgorithm/
Personal blog
www.ashimlamichhane.com.np
The document discusses linked lists and their implementation in C. It defines linked lists as dynamic data structures that store data in nodes linked together via pointers. The key operations on linked lists include insertion and deletion of nodes, as well as traversing and searching the list. It describes implementing linked lists as singly linked lists, doubly linked lists, and circular linked lists. Functions are provided for basic linked list operations like insertion, deletion, display on singly linked lists, and implementations of stacks and queues using linked lists.
The document discusses different types of linked lists including:
- Singly linked lists that can only be traversed in one direction.
- Doubly linked lists that allow traversal in both directions using forward and backward pointers.
- Circular linked lists where the last node points back to the first node allowing continuous traversal.
- Header linked lists that include a header node at the beginning for simplified insertion and deletion. Header lists can be grounded where the last node contains a null pointer or circular where the last node points to the header.
- Two-way or doubly linked lists where each node contains a forward and backward pointer allowing bidirectional traversal through the list.
Linked lists are linear data structures where each node points to the next. Each node contains a data field and a pointer to the next node. There are three types: singly, doubly, and circular linked lists. Linked lists allow for constant-time insertions and deletions and do not require fixed size allocation. Common operations on linked lists include insertion, deletion, searching, and traversal. Linked lists are useful for implementations like stacks, queues, and dynamic data structures.
The document discusses double and circular linked lists. It covers inserting and deleting nodes from doubly linked lists and circular linked lists. Specifically, it describes how to insert nodes at different positions in a doubly linked list, such as at the front, after a given node, at the end, and before a given node. It also explains how to delete nodes from a doubly linked list. For circular linked lists, it outlines how to insert nodes in an empty list, at the beginning, at the end, and between nodes. It also provides the steps to delete nodes from a circular linked list.
Linked lists are linear data structures where each node contains a data field and a pointer to the next node. There are two types: singly linked lists where each node has a single next pointer, and doubly linked lists where each node has next and previous pointers. Common operations on linked lists include insertion and deletion which have O(1) time complexity for singly linked lists but require changing multiple pointers for doubly linked lists. Linked lists are useful when the number of elements is dynamic as they allow efficient insertions and deletions without shifting elements unlike arrays.
This document discusses various methods for data visualization including the classics of tables, pie charts, line graphs and bar charts. It provides advice on effective visualization from Seth Godin including telling a story, following simple rules like having time go from left to right, and breaking rules. Newer techniques like network diagrams, word clouds and infographics are presented. The future of data visualization is said to involve precise analysis of data propagation online using tools like the NYT Cascade project.
Maven is a build automation tool used to manage Java projects through their build, reporting, and documentation lifecycles. It is based on conventions like standard directory layout and dependency management that allow reuse of build logic. Maven projects are created using the mvn archetype:create command and common commands include mvn compile, package, install, clean, and site. The Eclipse Maven plugin integrates Maven projects into the Eclipse IDE.
This document provides an overview of cryptography concepts including:
- Cryptography involves encrypting plaintext into ciphertext and decrypting ciphertext back to plaintext using cryptographic algorithms and keys.
- Symmetric key cryptography uses the same key for encryption and decryption while public key cryptography uses separate public and private keys.
- Stream ciphers generate a random keystream to encrypt plaintext bit-by-bit while block ciphers use a codebook to encrypt blocks of plaintext.
- The A5/1 stream cipher was used in GSM and works by XORing bits from three shift registers to generate the keystream.
The document discusses data mining and knowledge discovery from large data sets. It begins by defining the terms data, information, knowledge, and wisdom in a hierarchy. It then explains that the growth of data from various sources has created a need for data mining to extract useful knowledge from large data repositories. The key aspects of data mining discussed are that it aims to discover previously unknown, implicit and potentially useful patterns from large data sets in an automated manner. The document outlines the interdisciplinary nature of data mining and its relationship to knowledge discovery in databases. It describes the types of data that can be mined, including structured, transactional, time-series and web data, as well as common data mining tasks like classification, prediction and clustering.
The document proposes optimizing DRAM caches for latency rather than hit rate. It summarizes previous work on DRAM caches like Loh-Hill Cache that treated DRAM cache similarly to SRAM cache. This led to high latency and low bandwidth utilization.
The document introduces the Alloy Cache design which avoids tag serialization and keeps tags and data in the same DRAM row for lower latency. It also proposes a Memory Access Predictor to selectively use parallel or serial access models for the lowest latency. Simulation results show Alloy Cache with a predictor outperforms previous designs like SRAM-Tags. The document advocates optimizing DRAM caches for latency first before hit rate given their different constraints compared to SRAM caches.
A network connects two or more computers allowing them to communicate and share resources. Common networks include home, school, office and wireless networks. Networks can be local area networks (LANs) within a building or wide area networks (WANs) spanning multiple locations. Components needed to set up a basic network include network interface cards for each computer, network cables or wireless connectivity, and switches or routers to connect multiple devices and interfaces. Larger networks may include various server computers providing centralized services and resources to client computers on the network.
Array implementation and linked list as datat structureTushar Aneyrao
The document discusses arrays and linked lists. It defines arrays as collections of elements of the same data type stored in contiguous memory. Linked lists store elements in memory locations that are not contiguous. Each element of a linked list contains a data field and a pointer to the next node. This allows for efficient insertion and deletion of nodes compared to arrays. The document provides examples of implementing common linked list operations like insertion at the head, tail, and deletion.
The document discusses sorting algorithms, abstract data types (ADTs), and linked lists. It describes selection sort and insertion sort algorithms for sorting arrays. It then explains that linked lists are a more flexible data structure than arrays and defines a singly linked list as an ADT with nodes that point to the next node in the list. Functions for typical linked list operations like insertion, deletion, checking if empty, and printing the list are discussed.
Bca data structures linked list mrs.sowmya jyothiSowmya Jyothi
1. Linked lists are a linear data structure where each element contains a data field and a pointer to the next element. This allows flexible insertion and deletion compared to arrays.
2. Each node of a singly linked list contains a data field and a next pointer. Traversal follows the next pointers from head to tail. Doubly linked lists add a back pointer for bidirectional traversal.
3. Common operations on linked lists include traversal, search, insertion at head/specific point, and deletion by adjusting pointers. Memory for new nodes comes from a free list, and deleted nodes return there.
1) Linked lists are a data structure that store elements in individual nodes that are connected to each other using pointers. This allows for dynamic memory allocation as opposed to static allocation in arrays.
2) The basic operations on linked lists include creation, insertion, deletion, traversal, searching, concatenation, and displaying the list. Insertion and deletion can be done at the beginning, middle, or end of the list.
3) Linked lists are useful for applications that require dynamic memory allocation, like stacks, queues, and storing objects that may vary in number, such as images to burn to a CD.
This document discusses different types of linked lists including header linked lists, circular header linked lists, grounded header linked lists, two-way linked lists, and provides algorithms for traversing, searching, inserting, and deleting nodes from circular header and two-way linked lists. Header linked lists contain a special header node and can be circular or grounded. Circular header linked lists have the last node point to the header node, while grounded lists have the last node point to null. Two-way lists contain forward and backward pointers to traverse in both directions. Algorithms for traversing, searching, and modifying nodes in circular header and two-way lists are presented.
The document discusses linked lists as an alternative to arrays for storing data. It provides 3 key points:
1. Linked lists store data in nodes that are linked together using pointers, rather than in a fixed contiguous block of memory like arrays. Each node contains a data field and a pointer to the next node.
2. Common linked list operations like insertion, deletion, and searching have time complexities of O(1) or O(n) depending on the position in the list, which can be more efficient than arrays that require shifting elements.
3. The document presents a simple C++ implementation of a linked list using Node and List classes to demonstrate how to implement basic linked list functions like insertion, deletion
The document discusses different types of linked lists including singly linked lists, doubly linked lists, and circularly linked lists. Singly linked lists contain nodes that point to the next node in the list, while doubly linked lists contain nodes that point to both the next and previous nodes. Circularly linked lists form a circle with the last node pointing back to the first node. The document provides code examples for common linked list operations like insertion, removal and traversal for each of the linked list types.
In computer science, a linked list is a linear collection of data elements, whose order is not given by their physical placement in memory. Instead, each element points to the next. It is a data structure consisting of a collection of nodes which together represent a sequence.
A data structure is a way of storing data in computer memory so that it can be retrieved and manipulated efficiently. There are two main categories of data structures: linear and non-linear. Linear data structures include arrays, stacks, and queues where elements are stored in a linear order. Non-linear structures include trees and graphs where elements are not necessarily in a linear order. Common operations on data structures include traversing, searching, insertion, deletion, sorting, and merging. Algorithms use data structures to process and solve problems in an efficient manner.
This document discusses linked lists, their types, operations, and applications. It covers:
- Linked lists are dynamic data structures that allow elements to be added or removed easily. They consist of nodes that point to the next node.
- The main types are single linked lists, doubly linked lists, and circular linked lists. Doubly linked lists allow traversal in both directions.
- Basic linked list operations include initialization, adding elements, traversing nodes, and removing elements.
- Linked lists can be used to implement stacks, queues, and priority queues. They are also useful for simulation models using events.
a. Concept and Definition✓
b. Inserting and Deleting nodes ✓
c. Linked implementation of a stack (PUSH/POP) ✓
d. Linked implementation of a queue (Insert/Remove) ✓
e. Circular List
• Stack as a circular list (PUSH/POP) ✓
• Queue as a circular list (Insert/Remove) ✓
f. Doubly Linked List (Insert/Remove) ✓
For more course related material:
https://github.com/ashim888/dataStructureAndAlgorithm/
Personal blog
www.ashimlamichhane.com.np
The document discusses linked lists and their implementation in C. It defines linked lists as dynamic data structures that store data in nodes linked together via pointers. The key operations on linked lists include insertion and deletion of nodes, as well as traversing and searching the list. It describes implementing linked lists as singly linked lists, doubly linked lists, and circular linked lists. Functions are provided for basic linked list operations like insertion, deletion, display on singly linked lists, and implementations of stacks and queues using linked lists.
The document discusses different types of linked lists including:
- Singly linked lists that can only be traversed in one direction.
- Doubly linked lists that allow traversal in both directions using forward and backward pointers.
- Circular linked lists where the last node points back to the first node allowing continuous traversal.
- Header linked lists that include a header node at the beginning for simplified insertion and deletion. Header lists can be grounded where the last node contains a null pointer or circular where the last node points to the header.
- Two-way or doubly linked lists where each node contains a forward and backward pointer allowing bidirectional traversal through the list.
Linked lists are linear data structures where each node points to the next. Each node contains a data field and a pointer to the next node. There are three types: singly, doubly, and circular linked lists. Linked lists allow for constant-time insertions and deletions and do not require fixed size allocation. Common operations on linked lists include insertion, deletion, searching, and traversal. Linked lists are useful for implementations like stacks, queues, and dynamic data structures.
The document discusses double and circular linked lists. It covers inserting and deleting nodes from doubly linked lists and circular linked lists. Specifically, it describes how to insert nodes at different positions in a doubly linked list, such as at the front, after a given node, at the end, and before a given node. It also explains how to delete nodes from a doubly linked list. For circular linked lists, it outlines how to insert nodes in an empty list, at the beginning, at the end, and between nodes. It also provides the steps to delete nodes from a circular linked list.
Linked lists are linear data structures where each node contains a data field and a pointer to the next node. There are two types: singly linked lists where each node has a single next pointer, and doubly linked lists where each node has next and previous pointers. Common operations on linked lists include insertion and deletion which have O(1) time complexity for singly linked lists but require changing multiple pointers for doubly linked lists. Linked lists are useful when the number of elements is dynamic as they allow efficient insertions and deletions without shifting elements unlike arrays.
This document discusses various methods for data visualization including the classics of tables, pie charts, line graphs and bar charts. It provides advice on effective visualization from Seth Godin including telling a story, following simple rules like having time go from left to right, and breaking rules. Newer techniques like network diagrams, word clouds and infographics are presented. The future of data visualization is said to involve precise analysis of data propagation online using tools like the NYT Cascade project.
Maven is a build automation tool used to manage Java projects through their build, reporting, and documentation lifecycles. It is based on conventions like standard directory layout and dependency management that allow reuse of build logic. Maven projects are created using the mvn archetype:create command and common commands include mvn compile, package, install, clean, and site. The Eclipse Maven plugin integrates Maven projects into the Eclipse IDE.
This document provides an overview of cryptography concepts including:
- Cryptography involves encrypting plaintext into ciphertext and decrypting ciphertext back to plaintext using cryptographic algorithms and keys.
- Symmetric key cryptography uses the same key for encryption and decryption while public key cryptography uses separate public and private keys.
- Stream ciphers generate a random keystream to encrypt plaintext bit-by-bit while block ciphers use a codebook to encrypt blocks of plaintext.
- The A5/1 stream cipher was used in GSM and works by XORing bits from three shift registers to generate the keystream.
The document discusses data mining and knowledge discovery from large data sets. It begins by defining the terms data, information, knowledge, and wisdom in a hierarchy. It then explains that the growth of data from various sources has created a need for data mining to extract useful knowledge from large data repositories. The key aspects of data mining discussed are that it aims to discover previously unknown, implicit and potentially useful patterns from large data sets in an automated manner. The document outlines the interdisciplinary nature of data mining and its relationship to knowledge discovery in databases. It describes the types of data that can be mined, including structured, transactional, time-series and web data, as well as common data mining tasks like classification, prediction and clustering.
The document proposes optimizing DRAM caches for latency rather than hit rate. It summarizes previous work on DRAM caches like Loh-Hill Cache that treated DRAM cache similarly to SRAM cache. This led to high latency and low bandwidth utilization.
The document introduces the Alloy Cache design which avoids tag serialization and keeps tags and data in the same DRAM row for lower latency. It also proposes a Memory Access Predictor to selectively use parallel or serial access models for the lowest latency. Simulation results show Alloy Cache with a predictor outperforms previous designs like SRAM-Tags. The document advocates optimizing DRAM caches for latency first before hit rate given their different constraints compared to SRAM caches.
A network connects two or more computers allowing them to communicate and share resources. Common networks include home, school, office and wireless networks. Networks can be local area networks (LANs) within a building or wide area networks (WANs) spanning multiple locations. Components needed to set up a basic network include network interface cards for each computer, network cables or wireless connectivity, and switches or routers to connect multiple devices and interfaces. Larger networks may include various server computers providing centralized services and resources to client computers on the network.
Python is a multi-paradigm programming language that is object-oriented, imperative and functional. It is dynamically typed, with support for complex data types like lists and strings. Python code is commonly written and executed using the interactive development environment IDLE.
Motivation for multithreaded architecturesYoung Alista
The document discusses the motivation for and design of multithreaded architectures. It aims to increase processor utilization by allowing multiple independent instruction streams, or threads, to execute simultaneously. This can compensate for a lack of instruction-level parallelism in individual threads. Simultaneous multithreading (SMT) processors in particular issue instructions from multiple threads each cycle without hardware context switching. SMT achieves high throughput with minimal performance degradation to individual threads by sharing most hardware resources between threads.
The document discusses various cryptographic techniques including:
- Block ciphers like the Shift Cipher, Substitution Cipher, Affine Cipher, Vigenere Cipher, Hill Cipher, and Permutation Cipher.
- Stream ciphers like the Linear Feedback Shift Register (LFSR) cipher.
- Public key cryptography techniques including RSA, Rabin, and the Digital Signature Algorithm (DSA).
- Modes of operation for block ciphers like Electronic Codebook (ECB), Cipher Block Chaining (CBC), Cipher Feedback (CFB), and Output Feedback (OFB).
This document discusses numeric computation and problem space search in Prolog. It provides examples of solving the knapsack problem and 8-queens problem through search. For knapsack, it shows representing item weights and values, defining legal knapsacks within a weight limit, and finding the knapsack with maximum value. For 8-queens, it explains the problem and represents queen positions compactly before searching for a solution.
Prolog is a logic programming language well-suited for problems involving structured objects and relations. The document discusses how Prolog represents relations through facts and rules. Facts unconditionally declare true instances of a relation, like "parent(tom, bob)". Rules specify conclusions that are true if conditions are met, written as "conclusion :- conditions". For example, the offspring relation is defined with the rule "offspring(Y, X) :- parent(X, Y)". Questions can then be asked and answered based on the defined facts and rules.
- Decision trees are a supervised learning technique used for classification problems. They work by recursively splitting a dataset based on the values of predictor variables and assigning class labels to the terminal nodes.
- The document describes how decision trees are constructed by starting with the entire training set at the root node and then recursively splitting the data into purer child nodes based on attribute values. Attribute selection at each node is done using an impurity-based heuristic like information gain.
This document discusses data structures and algorithms. It begins by defining data structures as the logical organization of data and primitive data types like integers that hold single pieces of data. It then discusses static versus dynamic data structures and abstract data types. The document outlines the main steps in problem solving as defining the problem, designing algorithms, analyzing algorithms, implementing, testing, and maintaining solutions. It provides examples of space and time complexity analysis and discusses analyzing recursive algorithms through repeated substitution and telescoping methods.
The document discusses abstract data types (ADTs) and how they relate to implemented data types and data structures. Some key points:
1) An ADT is a theoretical model that defines the operations and objects of a data type, while an implemented data type realizes the ADT within the constraints of resources and implementation.
2) An ADT includes the name, possible data items, and operations on those items. Implemented data types and data structures then provide actual realizations within programming languages.
3) Common ADTs include stacks, with operations like push and pop following a last-in first-out ordering of elements. Stacks have implementations using arrays or linked lists.
The document discusses non-uniform cache architectures (NUCA), cache coherence, and different implementations of directories in multicore systems. It describes NUCA designs that map data to banks based on distance from the controller to exploit non-uniform access times. Cache coherence is maintained using directory-based protocols that track copies of cache blocks. Directories can be implemented off-chip in DRAM or on-chip using duplicate tag stores or distributing the directory among cache banks.
Abstract classes and interfaces allow for abstraction and polymorphism in object-oriented design. Abstract classes can contain both abstract and concrete methods, while interfaces only contain abstract methods. Abstract classes are used to provide a common definition for subclasses through inheritance, while interfaces define a contract for implementing classes to follow. Both support polymorphism by allowing subclasses/implementing classes to determine the specific implementation for abstract methods.
1) Game theory analyzes strategic decision-making between players in situations called games. Games can be modeled using normal or extensive form.
2) In normal form, all choices are made simultaneously. Players choose strategies and receive payoffs. Strategies can be dominated by others.
3) Extensive form models sequential choices using game trees. Backward induction analyzes the optimal moves working backwards from the end of the tree. Imperfect information means some players don't know others' past actions.
This document provides an overview of Google App Engine for Java, including its key features and limitations. It discusses the App Engine stack, how to configure and run Java applications on App Engine using the Java Datastore, Mail, URL Fetch, Images, Memcache, and XMPP services. The document also covers quotas, the development SDK, and deploying/managing apps through the App Engine administration console.
This document discusses advanced DNS topics including DHCP auto-updates, DNS security techniques like restricting zone transfers and using IP or crypto controls, the risks of open resolvers allowing DDoS amplification attacks, and other DNS uses like DNS blacklists (DNSBLs) and ENUM. It provides best practices for DNS configuration such as not mixing authoritative and caching servers, closing resolvers, using $ORIGIN in zone files, and documenting all changes.
The document discusses hash functions and message authentication codes (MACs). It begins by defining hash functions and MACs, noting that hash functions generate a fingerprint for a message without a key while MACs use a keyed hash function. It then covers security requirements for hash functions like one-wayness and collision resistance. Popular hash functions are described like MD5, SHA-1, and the SHA-2 family. Constructions for hash functions based on block ciphers and iterated hash functions are also outlined. The document concludes by comparing hash functions and MACs and describing common MAC constructions.
Linked list and its operations - Traversalkasthurimukila
The document discusses linked lists and operations performed on singly linked lists. It defines a linked list as a data structure containing nodes that point to the next node in the list. Singly linked lists contain nodes with a data field and pointer to the next node. Common operations on singly linked lists include traversing the list, inserting and deleting nodes from different positions, searching for a node, sorting list elements, and merging two linked lists.
This document discusses different types of linked lists including singly linked lists, circular linked lists, and doubly linked lists. It provides details on representing stacks and queues using linked lists. Key advantages of linked lists over arrays are that linked lists can dynamically grow in size as needed, elements can be inserted and deleted without shifting other elements, and there is no memory wastage. Operations like insertion, deletion, traversal, and searching are described for singly linked lists along with sample C code to implement a linked list, stack, and queue.
This document discusses linked lists and representing stacks and queues using linked lists. It provides information on different types of linked lists including singly, doubly, and circular linked lists. It describes inserting, deleting, and traversing nodes in a singly linked list. It also provides a C program example to implement a stack using a linked list with functions for push, pop, and display operations. The document discusses how linked lists are dynamic data structures that can grow and shrink in size as needed, unlike arrays.
This document provides information on various operations that can be performed on linked lists, including inserting, deleting, searching, sorting, and reversing nodes. It begins by explaining how to create a basic linked list with three nodes by allocating memory for each node, assigning data values, and connecting the nodes. It then discusses functions for inserting nodes at the beginning, middle, or end of the list. Other operations covered include traversing the list, deleting nodes, searching for a value, sorting nodes, and reversing the order of nodes. Code examples are provided for many of the operations.
This document discusses the implementation of a single linked list data structure. It describes the nodes that make up a linked list, which have an info field to store data and a next field pointing to the next node. The document outlines different ways to represent linked lists, including static arrays and dynamic pointers. It also provides algorithms for common linked list operations like traversing, inserting, and deleting nodes from the beginning, end, or a specified position within the list.
The document provides information on linked lists including:
- Linked lists are a linear data structure where each node contains data and a pointer to the next node.
- They allow for dynamic memory allocation and easier insertion/deletion than arrays.
- Common types include singly linked, doubly linked, circular singly/doubly linked lists.
- The document describes creating linked lists in C using structures, and operations like insertion, deletion, searching.
ccvcvbcbvcbvcbvcbvcb vngfg hgjhg gj jgjhgjhgjhg jhgh jhgjhgj gjhgjhgjhgjhgjhgjhgjhg jghgjhgjhgjhgjhg jjghjhgjhgjhgjhgjh hgjhgjhgjhgjhgjhgjhgjgjhgjhgjhg hgfgfhdfhtftfj jgyjyyyugyugyug yjgghgjhgjhf drdfhgfgfgfgj jgjhgjhgjhgjhgjhg jhgghjfgf fxdx gfd hdhfd tftyf yytfy ytftyf ytf ytfty fytftykgh kghjg jhghgh fgfghfgh fgfghfgf gfgfgfgfytf hgfggf ghfgfg gjhghjg cfffgh jgfgfhgffhg hghh yuy ygyyuyutyutyu jgfghfhgfghfh fghfhgfhgf fthfhfhf hfhfhgf hfhgfghf fghfghfghfhhgfghf jgjhgjhgjhgjhgjhgj jgjhgjh jgjhg jgjhgjhgjhg jhgjhgjhg jhgjhg jhgjhgollowing the announcement of Google+ API deprecation scheduled for March 2019, a number of changes will be made to Blogger’s Google+ integration on 4 February 2019. *Google+ widgets:* Support for the “+1 Button”, “Google+ Followers” and “Google+ Badge” widgets in Layout will no longer be available. All instances of these widgets will be removed from all blogs. *+1 buttons:* The +1/G+ buttons and Google+ share links below blog posts and in the navigation bar will be removed. Please note that if you have a custom template that includes Google+ features, you may need to update ... read more ollowing the announcement of Google+ API deprecation scheduled for March 2019, a number of changes will be made to Blogger’s Google+ integration on 4 February 2019. *Google+ widgets:* Support for the “+1 Button”, “Google+ Followers” and “Google+ Badge” widgets in Layout will no longer be available. All instances of these widgets will be removed from all blogs. *+1 buttons:* The +1/G+ buttons and Google+ share links below blog posts and in the navigation bar will be removed. Please note that if you have a custom template that includes Google+ features, you may need to update ... read moreollowing the announcement of Google+ API deprecation scheduled for March 2019, a number of changes will be made to Blogger’s Google+ integration on 4 February 2019. *Google+ widgets:* Support for the “+1 Button”, “Google+ Followers” and “Google+ Badge” widgets in Layout will no longer be available. All instances of these widgets will be removed from all blogs. *+1 buttons:* The +1/G+ buttons and Google+ share links below blog posts and in the navigation bar will be removed. Please note that if you have a custom template that includes Google+ features, you may need to update ... read moreollowing the announcement of Google+ API deprecation scheduled for March 2019, a number of changes will be made to Blogger’s Google+ integration on 4 February 2019. *Google+ widgets:* Support for the “+1 Button”, “Google+ Followers” and “Google+ Badge” widgets in Layout will no longer be available. All instances of these widgets will be removed from all blogs. *+1 buttons:* The +1/G+ buttons and Google+ share links below blog posts and in the navigation bar will be removed. Please note that if you have a custom template that includes Google+ features, you may need to update ... read moreollowing the announcement of Google+ API deprecation scheduled for March 2019, a nu
The document discusses linked lists and their basic operations. It defines a linked list as a series of connected nodes where each node contains a data element and a pointer to the next node. The basic operations of linked lists include inserting nodes, finding or deleting nodes by value, and traversing the list. It also discusses different types of linked lists like singly linked lists, doubly linked lists, and circular linked lists. The document explains how to implement operations like insertion, deletion, and traversal in detail with examples.
This document discusses different operations on linked lists such as insertion, deletion, and traversal. It begins with an introduction to linked lists explaining that each node contains a data field and pointer to the next node. It then covers implementing a basic node structure and various functions like creating a new node, adding a node to the beginning or end of the list, and deleting a node from the beginning, end, or a given position. Traversal and keeping track of previous nodes is important for operations like deletion from within the list. The document provides pseudocode to demonstrate common linked list operations.
Doubly linked lists are lists where each node contains a pointer to the next node and previous node. Each node stores data and pointers to the next and previous nodes. Finding a node requires searching the list using the next pointers until the desired node is found or the end is reached. Inserting a node involves finding the correct location and adjusting the next and previous pointers of the neighboring nodes. Headers and trailers can simplify insertion and deletion by avoiding special cases for the first and last nodes. Large integers can be represented using a special linked list implementation that treats each digit as a node.
Linked lists are dynamic data structures that can grow and shrink during program execution. Each node contains a data item and a pointer to the next node. This allows for efficient insertion and deletion by changing the pointers. There are different types of linked lists including singly linked, doubly linked, and circular linked lists. Operations like traversing, searching, inserting, and deleting can be performed on linked lists through manipulating the pointers between nodes.
This document provides an overview of different data structures including linked data structures, arrays, and pointers. It discusses linked lists, their advantages over arrays, and different types of linked lists including singly linked lists, doubly linked lists, and circular linked lists. It also covers pointers, how they store addresses, and pointer variables.
This document discusses linked lists as a solution to problems with arrays. It provides definitions and examples of linked lists, including:
- Each node contains a data element and a pointer to the next node
- A linked list is a series of connected nodes with a head pointer pointing to the first node
- Operations like insertion, deletion, and searching have linear time complexity of O(n) in the worst case
- Variations include circular and doubly linked lists
This document provides an overview of different data structures and sorting algorithms. It begins with an introduction to data structures and describes linear data structures like arrays, stacks, queues, and linked lists as well as non-linear data structures like trees and graphs. It then provides more detailed descriptions of stacks, queues, linked lists, and common sorting algorithms like selection sort and bubble sort.
This document provides information on linked lists. Some key points:
- A linked list is a dynamic data structure where elements are linked using pointers. Each element contains a data field and a pointer to the next node.
- There are different types of linked lists including singly linked, doubly linked, circular, and circular doubly linked lists.
- Common linked list operations include insertion, deletion, traversal, searching, and sorting. Algorithms for performing these operations on singly linked lists are presented.
- Linked lists can be used to implement other data structures like stacks, where the top element is tracked using a pointer instead of using array indices. Pseudocode for push and pop operations on a linked list implementation of
This document provides an overview of basic data structures in Python including stacks, queues, deques, and linked lists. It describes each data structure as an abstract data type with common operations. Implementations of each data structure are provided using Python classes. The stack, queue, and deque classes implement the respective data structures using Python lists. The linked list class implements nodes to link elements and allow for traversal. Examples are given demonstrating usage of each data structure implementation.
This document discusses linked lists and their implementation. It begins by defining a list as a sequence of zero or more elements of a given type that can be linearly ordered. Linked lists are introduced as a flexible data structure that uses nodes connected by pointers to dynamically allocate elements in memory. The key operations on linked lists are described, including appending, traversing, inserting, deleting nodes. Code examples are provided to implement these operations using a ListNode struct containing a data element and pointer to the next node. Functions like appendNode and displayList are demonstrated, with appendNode adding to the end of the list and displayList traversing the list to output each element.
Revisiting a data structures in detail with linked list stack and queuessuser7319f8
This document discusses various data structures including arrays, stacks, queues, and linked lists. It provides code examples for creating and manipulating each type of data structure. Specifically, it shows code for inserting and deleting elements from arrays and linked lists. It also includes algorithms and code for common stack and queue operations like push, pop, enqueue, and dequeue. The document provides a detailed overview of linear and non-linear data structures.
Linked list using Dynamic Memory Allocationkiran Patel
A linked list is a linear data structure where each node contains a link to the next node. There are several types of linked lists including singly-linked, doubly-linked, circular, and circular doubly-linked lists. Linked lists allow for efficient insertion and removal of nodes and can grow and shrink dynamically. Common operations on linked lists include creation, insertion, deletion, traversal, searching, and concatenation.
This document discusses serialization in .NET. Serialization is the process of converting an object graph to a linear sequence of bytes to send over a stream. The document covers basic serialization using attributes, implementing interfaces like ISerializable for custom serialization, and creating custom formatters. Key points are that types must be marked as serializable, an object graph contains referenced objects, and interfaces like ISerializable and IDeserializationEventListener allow customizing the serialization process.
The document provides an overview of business analytics (BA) including its history, types, examples, challenges, and relationship to data mining. BA involves exploring past business performance data to gain insights and guide planning. It can focus on specific business segments. Types of BA include reporting, affinity grouping, clustering, and predictive analytics. Challenges to BA include acquiring high quality data and rapidly processing large volumes of data. Data mining is an important part of BA, helping to sort and analyze large datasets.
The document discusses memory hierarchy and cache performance. It introduces the concepts of memory hierarchy, cache hits, misses, and different types of cache organizations like direct mapped, set associative, and fully associative caches. It analyzes how cache performance is affected by miss rate, miss penalty, block size, cache size, and associativity. Adding a second level cache can help reduce the miss penalty and improve overall performance.
This document discusses how Analysis Services caching works and provides strategies for warming the Storage Engine and Formula Engine caches. It explains that the Storage Engine handles data retrieval from disk while the Formula Engine determines which data is needed for queries. Caching can improve performance but requires consideration of memory usage, cache structures, and data granularity. The document recommends using the CREATE CACHE statement and running regular queries to pre-populate the caches, while being mindful of how security and non-deterministic elements can impact cache sharing and scoping. Automating cache warming through SQL Server Agent jobs or SSIS packages is suggested.
The document discusses the key elements of the object model, including abstraction, encapsulation, modularity, and hierarchy. It explains that abstraction is one of the fundamental ways to cope with complexity in software design. Abstraction focuses on the essential characteristics of an object that distinguish it from other objects, from the perspective of the viewer. The object model provides a conceptual framework for object-oriented programming that is based on these elements.
Optimizing shared caches in chip multiprocessorsYoung Alista
Chip multiprocessors, which place multiple processors on a single chip, have become common in modern processors. There are different approaches to managing caches in chip multiprocessors, including private caches for each processor or shared caches. The optimal approach balances factors like interconnect traffic, duplication of data, load balancing, and cache hit rates.
This document discusses abstract data types (ADTs) and their implementation in various programming languages. It covers the key concepts of ADTs including data abstraction, encapsulation, information hiding, and defining the public interface separately from the private implementation. It provides examples of ADTs implemented using modules in Modula-2, packages in Ada, classes in C++, generics in Java and C#, and classes in Ruby. Parameterized and encapsulation constructs are also discussed as techniques for implementing and organizing ADTs.
This document discusses the key concepts of object-oriented programming including abstraction, encapsulation, classes and objects. It defines abstraction as focusing on the essential characteristics of an object and hiding unnecessary details. Encapsulation hides the implementation of an object's methods and data. A class combines abstraction and encapsulation, defining the data attributes and methods while hiding implementation details. Objects are instantiations of classes that come to life through constructors and die through destructors.
This document discusses several programming paradigms and concepts related to multi-threaded programming. It covers single process vs multi process vs multi-core/multi-threaded programming. It also discusses processes, threads, synchronization mechanisms like semaphores and barriers, and concurrency issues like deadlock, starvation and livelock that can occur in multi-threaded programs.
This document discusses inheritance in object-oriented programming. It explains that inheritance allows a subclass to inherit attributes and behaviors from a superclass, extending the superclass. This allows for code reuse and the establishment of class hierarchies. The document provides an example of a BankAccount superclass and SavingsAccount subclass, demonstrating how the subclass inherits methods like deposit() and withdraw() from the superclass while adding its own method, addInterest(). It also discusses polymorphism and access control as related concepts.
The document provides information on three programming languages: COBOL, LISP, and Python. COBOL was released in 1959 and was used for 80% of business transactions due to its reliability. LISP was the second high-level language created in 1958 and introduced innovations like garbage collection and recursion using linked lists. Python was developed in the 1990s and prioritizes readability through features like whitespace and a simple grammar.
Object-oriented analysis and design (OOAD) emphasizes investigating requirements rather than solutions, and conceptual solutions that fulfill requirements rather than implementations. OOAD focuses on identifying domain concepts and defining software objects and how they collaborate. The document then discusses OO concepts like encapsulation, abstraction, inheritance, and polymorphism and how classes and objects are used in object-oriented programming. It provides an overview of the course structure and evaluation criteria.
The document discusses several topics in programming for engineers in Python including:
1) Sample problems, hash functions, dictionaries, and a car simulation will be covered.
2) Functions can be arguments to other functions, as shown through a function that prints "spam" twice when passed as an argument.
3) Fermat's Last Theorem is checked using a function, and it is shown that previous examples up to n=3 check out according to the theorem.
This document provides an overview of APIs, including what they are, why they are useful, common data formats like JSON and XML, RESTful API design principles, and how to consume and create APIs. It discusses topics like HTTP verbs, resources and URIs, caching, authentication, and error handling for APIs. The document also provides examples of consuming APIs with tools like Postman and creating a simple API in Node.js.
A program is a sequence of instructions that are run by the processor. To run a program, it must be compiled into binary code and given to the operating system. The OS then gives the code to the processor to execute. Functions allow code to be reused by defining operations and returning values. Strings are sequences of characters that can be manipulated using indexes and methods. Common string methods include upper() and concatenation using +.
1. Burp extensions can overcome web application hurdles through the Burp API. Interfaces like IMessageEditorTab and ITab allow creating new views of requests and responses, while processHTTPMessage and doPassiveScan can automate tasks by catching and rewriting traffic.
2. Examples include decoding custom encodings, signing requests, viewing unique response headers, and passively scanning for encoded values in cookies. Common problems are solved with minimal Python coding against the Burp API.
This document provides an introduction to Python programming for astronomers. It discusses:
- Setting up the Python environment and selecting the correct version (2.6/2.7 vs 3.x)
- Why Python is popular for astronomy (free, packages like CASA are in Python)
- Getting started with Python scripts and the Python interpreter
- Important syntax aspects like indentation, importing modules, and creating functions
- Examples of useful Python modules for astronomy like NumPy, SciPy, Matplotlib, and Astropy
This document provides an introduction to the Python programming language. It discusses installing Python and interacting with it through command line and IDLE modes. It covers basic Python data types like numbers, strings, lists, and booleans. It demonstrates how to perform operations and call functions on these data types. It also discusses Python modules, getting input from users, and commonly used string and list methods.
This document discusses Easyrec, an open source recommender engine that provides recommendations based on user actions like views, purchases, and ratings of products. It can be run locally or accessed via a REST API. The API allows users to input user data and product interactions to receive recommendations like similar products users viewed or purchased. Easyrec uses collaborative filtering to provide recommendations but has limited customization options compared to building a proprietary system.
This document discusses object-oriented programming concepts like abstraction, inheritance, and polymorphism in Java. It provides examples using a Dance Studio application with classes like Dancer, Foot, and MaleDancer/FemaleDancer to illustrate the concepts. Abstraction allows ignoring irrelevant details and focusing on relevant features. Encapsulation keeps data private within classes and exposes public interfaces. Inheritance creates parent-child class relationships and code reuse. Polymorphism ensures the right method is called based on an object's actual type.
In the rapidly evolving landscape of technologies, XML continues to play a vital role in structuring, storing, and transporting data across diverse systems. The recent advancements in artificial intelligence (AI) present new methodologies for enhancing XML development workflows, introducing efficiency, automation, and intelligent capabilities. This presentation will outline the scope and perspective of utilizing AI in XML development. The potential benefits and the possible pitfalls will be highlighted, providing a balanced view of the subject.
We will explore the capabilities of AI in understanding XML markup languages and autonomously creating structured XML content. Additionally, we will examine the capacity of AI to enrich plain text with appropriate XML markup. Practical examples and methodological guidelines will be provided to elucidate how AI can be effectively prompted to interpret and generate accurate XML markup.
Further emphasis will be placed on the role of AI in developing XSLT, or schemas such as XSD and Schematron. We will address the techniques and strategies adopted to create prompts for generating code, explaining code, or refactoring the code, and the results achieved.
The discussion will extend to how AI can be used to transform XML content. In particular, the focus will be on the use of AI XPath extension functions in XSLT, Schematron, Schematron Quick Fixes, or for XML content refactoring.
The presentation aims to deliver a comprehensive overview of AI usage in XML development, providing attendees with the necessary knowledge to make informed decisions. Whether you’re at the early stages of adopting AI or considering integrating it in advanced XML development, this presentation will cover all levels of expertise.
By highlighting the potential advantages and challenges of integrating AI with XML development tools and languages, the presentation seeks to inspire thoughtful conversation around the future of XML development. We’ll not only delve into the technical aspects of AI-powered XML development but also discuss practical implications and possible future directions.
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Speck&Tech
ABSTRACT: A prima vista, un mattoncino Lego e la backdoor XZ potrebbero avere in comune il fatto di essere entrambi blocchi di costruzione, o dipendenze di progetti creativi e software. La realtà è che un mattoncino Lego e il caso della backdoor XZ hanno molto di più di tutto ciò in comune.
Partecipate alla presentazione per immergervi in una storia di interoperabilità, standard e formati aperti, per poi discutere del ruolo importante che i contributori hanno in una comunità open source sostenibile.
BIO: Sostenitrice del software libero e dei formati standard e aperti. È stata un membro attivo dei progetti Fedora e openSUSE e ha co-fondato l'Associazione LibreItalia dove è stata coinvolta in diversi eventi, migrazioni e formazione relativi a LibreOffice. In precedenza ha lavorato a migrazioni e corsi di formazione su LibreOffice per diverse amministrazioni pubbliche e privati. Da gennaio 2020 lavora in SUSE come Software Release Engineer per Uyuni e SUSE Manager e quando non segue la sua passione per i computer e per Geeko coltiva la sua curiosità per l'astronomia (da cui deriva il suo nickname deneb_alpha).
Dr. Sean Tan, Head of Data Science, Changi Airport Group
Discover how Changi Airport Group (CAG) leverages graph technologies and generative AI to revolutionize their search capabilities. This session delves into the unique search needs of CAG’s diverse passengers and customers, showcasing how graph data structures enhance the accuracy and relevance of AI-generated search results, mitigating the risk of “hallucinations” and improving the overall customer journey.
Communications Mining Series - Zero to Hero - Session 1DianaGray10
This session provides introduction to UiPath Communication Mining, importance and platform overview. You will acquire a good understand of the phases in Communication Mining as we go over the platform with you. Topics covered:
• Communication Mining Overview
• Why is it important?
• How can it help today’s business and the benefits
• Phases in Communication Mining
• Demo on Platform overview
• Q/A
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...Neo4j
Leonard Jayamohan, Partner & Generative AI Lead, Deloitte
This keynote will reveal how Deloitte leverages Neo4j’s graph power for groundbreaking digital twin solutions, achieving a staggering 100x performance boost. Discover the essential role knowledge graphs play in successful generative AI implementations. Plus, get an exclusive look at an innovative Neo4j + Generative AI solution Deloitte is developing in-house.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slackshyamraj55
Discover the seamless integration of RPA (Robotic Process Automation), COMPOSER, and APM with AWS IDP enhanced with Slack notifications. Explore how these technologies converge to streamline workflows, optimize performance, and ensure secure access, all while leveraging the power of AWS IDP and real-time communication via Slack notifications.
Infrastructure Challenges in Scaling RAG with Custom AI modelsZilliz
Building Retrieval-Augmented Generation (RAG) systems with open-source and custom AI models is a complex task. This talk explores the challenges in productionizing RAG systems, including retrieval performance, response synthesis, and evaluation. We’ll discuss how to leverage open-source models like text embeddings, language models, and custom fine-tuned models to enhance RAG performance. Additionally, we’ll cover how BentoML can help orchestrate and scale these AI components efficiently, ensuring seamless deployment and management of RAG systems in the cloud.
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceIndexBug
Imagine a world where machines not only perform tasks but also learn, adapt, and make decisions. This is the promise of Artificial Intelligence (AI), a technology that's not just enhancing our lives but revolutionizing entire industries.
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-und-domino-lizenzkostenreduzierung-in-der-welt-von-dlau/
DLAU und die Lizenzen nach dem CCB- und CCX-Modell sind für viele in der HCL-Community seit letztem Jahr ein heißes Thema. Als Notes- oder Domino-Kunde haben Sie vielleicht mit unerwartet hohen Benutzerzahlen und Lizenzgebühren zu kämpfen. Sie fragen sich vielleicht, wie diese neue Art der Lizenzierung funktioniert und welchen Nutzen sie Ihnen bringt. Vor allem wollen Sie sicherlich Ihr Budget einhalten und Kosten sparen, wo immer möglich. Das verstehen wir und wir möchten Ihnen dabei helfen!
Wir erklären Ihnen, wie Sie häufige Konfigurationsprobleme lösen können, die dazu führen können, dass mehr Benutzer gezählt werden als nötig, und wie Sie überflüssige oder ungenutzte Konten identifizieren und entfernen können, um Geld zu sparen. Es gibt auch einige Ansätze, die zu unnötigen Ausgaben führen können, z. B. wenn ein Personendokument anstelle eines Mail-Ins für geteilte Mailboxen verwendet wird. Wir zeigen Ihnen solche Fälle und deren Lösungen. Und natürlich erklären wir Ihnen das neue Lizenzmodell.
Nehmen Sie an diesem Webinar teil, bei dem HCL-Ambassador Marc Thomas und Gastredner Franz Walder Ihnen diese neue Welt näherbringen. Es vermittelt Ihnen die Tools und das Know-how, um den Überblick zu bewahren. Sie werden in der Lage sein, Ihre Kosten durch eine optimierte Domino-Konfiguration zu reduzieren und auch in Zukunft gering zu halten.
Diese Themen werden behandelt
- Reduzierung der Lizenzkosten durch Auffinden und Beheben von Fehlkonfigurationen und überflüssigen Konten
- Wie funktionieren CCB- und CCX-Lizenzen wirklich?
- Verstehen des DLAU-Tools und wie man es am besten nutzt
- Tipps für häufige Problembereiche, wie z. B. Team-Postfächer, Funktions-/Testbenutzer usw.
- Praxisbeispiele und Best Practices zum sofortigen Umsetzen
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/building-and-scaling-ai-applications-with-the-nx-ai-manager-a-presentation-from-network-optix/
Robin van Emden, Senior Director of Data Science at Network Optix, presents the “Building and Scaling AI Applications with the Nx AI Manager,” tutorial at the May 2024 Embedded Vision Summit.
In this presentation, van Emden covers the basics of scaling edge AI solutions using the Nx tool kit. He emphasizes the process of developing AI models and deploying them globally. He also showcases the conversion of AI models and the creation of effective edge AI pipelines, with a focus on pre-processing, model conversion, selecting the appropriate inference engine for the target hardware and post-processing.
van Emden shows how Nx can simplify the developer’s life and facilitate a rapid transition from concept to production-ready applications.He provides valuable insights into developing scalable and efficient edge AI solutions, with a strong focus on practical implementation.
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc
How does your privacy program stack up against your peers? What challenges are privacy teams tackling and prioritizing in 2024?
In the fifth annual Global Privacy Benchmarks Survey, we asked over 1,800 global privacy professionals and business executives to share their perspectives on the current state of privacy inside and outside of their organizations. This year’s report focused on emerging areas of importance for privacy and compliance professionals, including considerations and implications of Artificial Intelligence (AI) technologies, building brand trust, and different approaches for achieving higher privacy competence scores.
See how organizational priorities and strategic approaches to data security and privacy are evolving around the globe.
This webinar will review:
- The top 10 privacy insights from the fifth annual Global Privacy Benchmarks Survey
- The top challenges for privacy leaders, practitioners, and organizations in 2024
- Key themes to consider in developing and maintaining your privacy program
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
1. List
Objectives
• Describe a list
• How a list can be implemented by linked
structure
• Implement the various operations on
linked list
2. List
• List is homogeneous collection of
elements, with linear relationship
between the elements, the list can be
ordered or unordered.
• Implementing list
List can be implemented using
1. Linear array
2. Linked list
3. Array implementation of lists
• The linear array can be created at the compilation time by
using type declaration statement of type
int a[100];
• Which create linear array with 100 elements
• Since each elements takes two bytes of memory, the
compiler allocates 200 bytes for the array.
• The above array can be created at run time with the
following declaration statement
int *a;
a=(int*)malloc(100*sizeof(int));
In the above declaration, the malloc() function allocates 200
bytes of memory and assign the address of the first byte to
the pointer variable a.
4. Limitations of an array
• Insertion and deletion operations are
expensive.
• Inserting at first position requires first
pushing the entire array down by one
position to make room.
• Deleting the first element requires shifting
all the elements in the list one position up.
• So worst case of these operation is O(n).
• Size of the list must be known in advance.
5. Linked implementation of list
• To avoid the linear cost of insertion and deletion
operations, we need to ensure that the elements
of the list are not stored contiguously.
• Linked list basically consists of series of
structures, which are not necessarily adjacent in
memory
• Each structure contains an element of the list
and a pointer to structure containing its
successor.
• Linked implementation allow traverse and
search operations to be carried out in linear
time.
• Insertion and deletion operations can be
implemented efficiently as it requires only
rearrangement of pointers.
6. Linked list defined
A linked list is a linear collection of data
elements, called nodes, the linear order is
given by pointers. Each node is divided
into two or more parts. Linked list can be
of following types:
• Linear linked list or one way list
• Doubly linked list or two way list
• Circular linked list
• Header linked list
7. Linear linked list
In a linear linked list, also called singly linked list or one
way linked list, each node is divided into two parts.
• First parts contain the information of the element
• Second part called the linked field or next pointer field,
contains the address of the next node in the list.
head
1200 1201 1202 1203 X
Next pointer field of 2nd
node
Information field of second node
•head is used to hold the address of first element of the list.
•Last element of the linked list have NULL value in the next pointer field to mark the
end of the list
8. Representation of Linear linked
list
Suppose we want to store the list of integer numbers, then
the linear linked list can be represented in memory with
the following declarations.
typedef struct nodetype
{
int info;
struct nodetype *next;
}node;
node *head;
The above declaration define a new data type, whose each
element is of type nodetype and gives it a name node.
9. Operation on Linear linked lists
• Creating an empty list
• Traversing a list
• Searching an element
• Inserting an element
• Deleting an element
10. Creating an empty list
• In the previous declaration, the variable head is declared
as pointer to node data type.
• Variable head is not yet given a value.
• This variable is used to point to the first element of the
list
• Since the list will be empty in the beginning, the variable
head is assigned a sentinel value to indicate the list is
empty.
void createemptylist(node **head)
{
*head=NULL;
}
11. Traversing a list
Linear list can be traversed in two ways
• In order traversal
• Reverse order traversal
In order traversal:
To traverse the linear linked list, we move along the pointer, and
process each element till we reach the last element.
void traverseinorder(node *head)
{
while(head!=NULL)
{
printf(“%dn”,head->info);
head=head->next;
}
}
12. Traversing a list
Reverse order traversal:
To traverse the linear linked list in reverse order, we move along the
pointer till we reach the last element. The last element is processed
first, then the second last and so on and finally the first element of
the list
To implement this we use either stack (LIFO) or recursion.
Void traversereverseorder(node *head)
{
if(head->next!=NULL)
{
traversereverseorder(head->next);
printf(“%dn”,head->info);
}
}
13. Searching an element
• In linear linked list, only linear searching
is possible.
• This is one of the limitation of the linked
list as there is no way to find the location
of the middle element of the list
List can be
1. Sorted
2. Unsorted
14. Searching an element
List is unsorted:
We traverse the list from the beginning, and compare
each element of the list with the given element say
item to be searched.
node *searchunsortedlist(node *head, int item)
{
while((head!=NULL) &&(head->info!=item))
head=head->next;
return head;
}
15. Searching an element
List is sorted:
If the list is sorted say in ascending order then we traverse the list from
beginning and compare each element of list with item to be
searched. If the match occurs, the location of the element is
returned. If we reach the element that is greater than item or end of
the list NULL value is returned.
node *searchinsortedlist(node *head, int item)
{
while(head!=NULL)
{
if(head->info==item)
return head;
else if (item<head->info)
return NULL;
else
head=head->next;
}
return NULL;
}
16. Inserting an element
To insert an element in the list, the first task is to
get a free node, assign the element to be
inserted to the info field of the node, and then
new node is placed at the appropriate position
by adjusting the appropriate pointer. The
insertion in the list can take place at the
following positions:
• At the beginning of the list
• At the end of the list
• After a given element
17. Inserting an element
Insert at the beginning of the list:
First test whether the linked list is initially empty, if yes,
then the element is inserted as the first and only one
element by performing the following steps:
• Assign NULL value to the next pointer field of the new
node
• Assign address of new node to head
If the list is not empty, then the element is inserted as the
first element of the list by performing the following steps:
• Assign value of head variable to the next pointer field of
the new node.
• Assign address of the new node to the head.
18. Inserting an element
Insert at the beginning of the list:
Void insertatbegining(node **head,int item)
{
node *ptr;
ptr=(node*)malloc(sizeof(node));
ptr->info=item;
if(*head==NULL)
ptr->next=NULL;
else
ptr->next=*head;
*head=ptr;
}
19. Inserting an element
Inserting at the end of the list:
First test whether the linked list is initially empty, if yes,
then the element is inserted as the first and only one
element by performing the following steps:
• Assign NULL value to the next pointer field of the new
node
• Assign address of new node to head
If the list is not empty, then the list is traversed to reach the
last element, and then element is inserted as the last
element of the list by performing the following steps:
• Assign NULL value to the next pointer field of the new
node
• Assign address of the new node to the next pointer field
of the last node.
20. Inserting an element
Void insertatend(node **head, int item)
{
node *ptr, *loc;
ptr=(node*)malloc(sizeof(node));
ptr->info=item;
ptr->next=NULL;
if(*head==NULL)
*head=ptr;
else
{
loc=*head;
while (loc->next!=NULL)
loc=loc->next;
loc->next=ptr;
}
}
21. Inserting an element
Inserting after given element:
To insert the new element after the given element,
first we find the location, say loc, of the given
element in the list, and then the element is
inserted in the list by performing following steps:
• Assign the next pointer field of the node pointed
by loc to the next pointer field of the new node.
• Assign address of the new node to the next
pointer field of the node pointed by loc.
22. Inserting an element
Void insertafterelement(node *head, int item,int after)
{
node *ptr, *loc;
loc=search(head,after);
if(loc==(node*)NULL) /*element after not found*/
return;
ptr=(node*)malloc(sizeof(node));
ptr->info=item;
ptr->next=loc->next;
loc->next=ptr;
}
23. Deleting an element
• To delete an element from the list, first
the pointer are set properly and then the
memory occupied by the node to be
deleted is deallocated(free).
• The deletion in the list can take place at
the following positions.
1. At the beginning of the list
2. At the end of the list
3. After a given element
24. Deleting from the beginning of the
list
An element from the beginning of the lists can be
deleted by performing following steps:
• Assign the value of head ( address of the first
element of the list) to a temporary variable (say
ptr)
• Assign the value of the next pointer field of the
first node to head.
• Deallocate the memory occupied by the node
pointed to by ptr.
25. Deleting from the beginning of the
list
Void deletefrombegining( node **head)
{
node *ptr;
if(*head==NULL)
return;
else
{
ptr=*head;
*head=(*head)->next;
free(ptr);
}
}
26. Deleting from the end of the list
To delete from the end of the list, we first traverse
to the second last element of the list. Then the
last element can be deleted by performing
following steps:
• Assign the next pointer field of the second last
node to a temporary variable ( say ptr).
• Assign value NULL to the next pointer field of
the second last node of the list.
• Deallocate the memory occupied by the node
pointed to by ptr.
27. Deleting from the end of the listVoid deletefromend( node **head)
{
node *ptr,*loc;
if (*head==NULL)
return;
else if ((*head)->next==(node*) NULL)
{
ptr=*head;
*head=NULL;
free(ptr);
}
else
{
loc=*head;
ptr=(*head)->next;
while(ptr->next!=NULL)
{
loc=ptr;
ptr=ptr->next;
}
loc->next=NULL;
free(ptr);
}
}
28. Deleting after a given element
To delete an element after a given element, first
we find the location say (loc) of the element after
which the element can be deleted by performing
the following steps:
• Assign next pointer field of the node pointed by
the loc to temporary variable (say ptr).
• Assign the next pointer field of the node to be
deleted to the node pointed to by loc
• Deallocate the memory occupied by the node
pointed to by ptr.
29. Deleting after a given element
Void deleteafterelement( node*head, int after)
{
node *ptr, *loc;
loc=search(head,after);
if(loc==(node*)NULL) /*element ‘after’ not found*/
return;
ptr=loc->next;
loc->next=ptr->next;
free(ptr);
}
30. Deleting Entire list
Before the program terminates, the entire list must
be deletedso that the memory occupied by the
nodes of the list can be used for other purposes.
This task can be accomplished by performing
the following steps:
• Assign the head pointer to a temporary variable,
say ptr.
• Advance the head pointer to the next node.
• Deallocate the memory occupied by the node
pointed to by ptr.
The above steps are repeated till the entire list is
deleted.
32. Doubly Linked List
In doubly linked list, also called the two way list,
each node is divided into three parts:
• The first part called, previous pointer field,
contains the address of preceding element in the
list.
• The second part contains the information of the
list.
• The third part, called next pointer field, contains
the address of the succeeding element in the
list.
In addition, two pointer variables, e.g. head and
tail, are used that contains the address of first
element and the address of last element of the
list.
33. Doubly Linked List
head
X 1200 1201 1203 X
Next pointer field of 2nd
node
Information field of second node
tail
Previous pointer field of 2nd
node
34. Representation of doubly linked list
• Suppose we want to store list of integer.
typedef struct nodetype
{
struct nodetype *prev;
int info;
struct nodetype *next;
}node;
node *head,*tail;
The above declaration defines a new data type, whose
each element is of type nodetype and gives it name
node.
35. Operation on Doubly linked lists
• Creating an empty list
• Traversing a list
• Searching an element
• Inserting an element
• Deleting an element
36. Creating an Empty list
• In the previous declaration, the variable head and tail are
declared as pointer to a node data type.
• These Variables are not yet given a value.
• The head is used to point to the first element of the list
and tail is used to point to the last element of the list.
• Since the list will be empty in the beginning, the variable
head and tail are assigned a sentinel value to indicate
the list is empty.
void createemptylist(node **head, node **tail)
{
*head=*tail=NULL;
}
37. Traversing a list
Doubly linked list can be traversed in both way and that too very
conveniently.
• In order traversal
• Reverse order traversal
In order traversal:
To traverse the doubly linked list, we move along the pointer, and
process each element till we reach the last element.
void traverseinorder(node *head)
{
while(head!=NULL)
{
printf(“%dn”,head->info);
head=head->next;
}
}
38. Traversing a list
Reverse order traversal:
The following listing shows the various steps required for
traversing a doubly linked list in the backward direction.
Void traversereverseorder(node *tail)
{
if(tail!=NULL)
{
printf(“%dn”,tail->info);
tail=tail->prev;
}
}
39. Searching an element
The doubly linked list can be traversed in any order to
reach the given element. The following listing shows the
various steps required for searching an element from the
beginning.
node *search (node *head, int item)
{
while(head!=NULL)
{
if(head->info==item)
return head;
head=head->next;
}
return NULL;
}
40. Inserting an element
To insert an element in the list, the first task is to
get a free node, assign the element to be
inserted to the info field of the node, and then
new node is placed at the appropriate position
by adjusting the appropriate pointer. The
insertion in the list can take place at the
following positions:
• At the beginning of the list
• At the end of the list
• After a given element
• Before a given element
41. Inserting an element
Insert at the beginning of the list:
First test whether the linked list is initially empty, if yes, then the
element is inserted as the first and only one element by performing
the following steps:
• Assign NULL value to the next pointer and prev pointer field of the
new node
• Assign address of new node to head and tail pointer variables.
If the list is not empty, then the element is inserted as the first element
of the list by performing the following steps:
• Assign NULL value to the prev pointer field of the new node.
• Assign value of head variable (the address of the first element of the
existing list) to the next pointer field of the new node.
• Assign address of the new node to prev pointer field of the node
currently pointed by head variable, i. e. first element of the existing
list.
• Finally Assign address of the new node to the head variable.
42. Inserting an element
Insert at the beginning of the list:
Void insertatbegining (node **head, node **tail, int item)
{
node *ptr;
ptr=(node*)malloc(sizeof(node));
ptr->info=item;
if(*head==NULL)
ptr->next=ptr->prev=NULL;
*head=*tail=ptr;
else
{
ptr->prev=NULL;
ptr->next=*head;
(*head)->prev=ptr;
*head=ptr;
}
}
43. Inserting an element
Inserting at the end of the list
First test whether the linked list is initially empty, if yes, then the
element is inserted as the first and only one element by
performing the following steps:
• Assign NULL value to the next pointer and prev pointer field of
the new node
• Assign address of new node to head and tail pointer variable.
If the list is not empty, then element is inserted as the last element
of the list by performing the following steps:
• Assign NULL value to the next pointer field of the new node.
• Assign value of the tail variable (the address of the last element
of the existing list) to the prev pointer field of the new node.
• Assign address of the new node to the next pointer field of the
node currently pointed by tail variable i.e last element of the
existing list.
• Finally assign the address of the new node to tail variable.
44. Inserting an element
Insert at the end of the list:
Void insertatend (node **head, node **tail, int item)
{
node *ptr;
ptr=(node*)malloc(sizeof(node));
ptr->info=item;
if(*head==NULL)
ptr->next=ptr->prev=NULL;
*head=*tail=ptr;
else
{
ptr->next=NULL;
ptr->prev=*tail;
(*tail)->next=ptr;
*tail=ptr;
}
}
45. Inserting an element
Inserting after a given element:
Void insert afterelement (node *head, node **tail, int item, int after)
{
node *ptr, *loc;
ptr=head;
loc=search(ptr,after);
if(loc==NULL)
return;
ptr=(node*)malloc(sizeof(node));
ptr->info=item;
if(loc->next==NULL)
{
ptr->next=NULL;
loc->next=ptr;
ptr->prev=*tail;
*tail=ptr;
}
else
{
ptr->prev=loc;
ptr->next=loc->next;
(loc->next)->prev=ptr;
loc->next=ptr;
}
}
46. Inserting an element
Inserting before a given element:
Void insertbeforeelement (node **head, int item, int before)
{
node *ptr, *loc;
ptr=*head;
loc=search(ptr,before);
if(loc==NULL)
return;
ptr=(node*)malloc(sizeof(node));
ptr->info=item;
if(loc->prev==NULL)
{
ptr->prev=NULL;
loc->prev=ptr;
ptr->next=*head;
*head=ptr;
}
else
{
ptr->prev=loc->prev;
ptr->next=loc;
(loc->prev)->next=ptr;
loc->prev=ptr;
}
}
47. Deleting an element
• To delete an element from the list, first the
pointer are set properly and then the memory
occupied by the node to be deleted is
deallocated (freed).
• The deletion in the list can take place at the
following positions.
1.At the beginning of the list
2.At the end of the list
3.After a given element
4.Before a given element
48. Deleting an element
Deleting from the beginning of the list:
An element from the beginning of the lists can be
deleted by performing following steps:
• Assign the value of head ( address of the first
element of the list) to a temporary variable (say ptr)
• Further there are two cases:
1. If there is only one element in the existing list, both
head and tail variable are set to NULL.
2. If there are more than one element in the list then
following steps are given below:
– Assign NULL value to the prev pointer field of the second
node.
– Assign address of the second node to head.
3. Deallocate the memory occupied by the node pointed to by
ptr.
49. Deleting an element
Deleting from the beginning of the list:
Void deletefrombegining( node **head, node **tail)
{
node *ptr;
if(*head==NULL)
return;
ptr=*head;
if(*head==*tail) /*one element only*/
*head=*tail=NULL;
else
{
(ptr->next)->prev=NULL;
*head=ptr->next;
}
free(ptr);
}
50. Deleting an element
Deleting from the end of the list:
An element from the end of the list can be deleted by
performing following steps:
• Assign the value of tail ( address of the last element of
the list) to a temporary variable (say ptr)
• Further there are two cases:
1.If there is only one element in the existing list, both
head and tail variable are set to NULL.
2.If there are more than one element in the list then
following steps are given below:
– Assign NULL value to the next pointer field of the second
last node.
– Assign address of the second last node to tail.
3.Deallocate the memory occupied by the node pointed to by
ptr.
51. Deleting an element
Deleting from the end of the list:
Void deletefromend( node **head, node **tail)
{
node *ptr;
if(*head==NULL)
return;
ptr=*tail;
if(*head==*tail) /*one element only*/
*head=*tail=NULL;
else
{
(ptr->prev)->next=NULL;
*tail=ptr->prev;
}
free(ptr);
}
52. Deleting an element
Deleting after a given element:
Void ideleteafterelement (node *head, node **tail, int item, int after)
{
node *ptr, *loc;
ptr=head;
loc=search(ptr,after);
if(loc==NULL)
return;
else if((loc->next)->next==NULL)
{
ptr=loc->next;
loc->next=NULL;
*tail=loc;
free(ptr);
}
else
{
ptr=loc->next;
loc->next=ptr->next;
(ptr->next)->prev=loc;
free(ptr);
}
}
53. Deleting an element
Deleting before a given element:
Void ideleteafterelement (node **head, int item, int before)
{
node *ptr, *loc;
ptr=head;
loc=search(ptr,before);
if(loc==NULL)
return;
else if((loc->prev)->prev==NULL)
{
ptr=loc->prev;
loc->prev=NULL;
*head=loc;
free(ptr);
}
else
{
ptr=loc->prev;
loc->prev=ptr->prev;
(ptr->prev)->next=loc;
free(ptr);
}
}
54. Deleting entire list
The doubly linked list can be deleted either by
heading from the beginning or from the end.
The list can be deleted from the beginning by
performing the following steps:
• Assign the head pointer to a temporary
variable, say ptr.
• Advance the head pointer to the next node.
• Deallocate the memory occupied by the node
pointed to by ptr.
The above steps are repeated till the entire list
is deleted. Finally the tail pointer is set to
NULL value.
56. Circular Linked List
A circular list is a linear linked list, except that the
last element points to the first element. For non
empty circular linked list there are no NULL
pointer.
The memory declarations for representing circular
linked lists are the same as for linear linked lists
Properties:
• Can reach entire list from any node
• Need special test for end of list
• Used as buffer
57. Circular Linked List
• A Circular Linked List is a special type of
Linked List
• It supports traversing from the end of the
list to the beginning by making the last
node point back to the head of the list.
• Circular linked lists are usually sorted
• Circular linked lists are useful for playing
video and sound files in “looping” mode.
• They are also a stepping stone to
implementing graphs, an important topic in
computer graphics.
58. Representation of Circular linked
list
Suppose we want to store the list of integer numbers, then
the circular linked list can be represented in memory with
the following declarations.
typedef struct nodetype
{
int info;
struct nodetype *next;
}node;
node *head;
The above declaration define a new data type, whose each
element is of type nodetype and gives it a name node.
59. Circular Linked List
All operations performed on linear linked list can be easily
extended for circular linked lists with following
exceptions:
1. While inserting new node at the end of the lists, its
next pointer field is made to point to the first node.
2. While testing for the end of the lists, we compare the
next pointer field with the address of the first node.
head
1201 1234 1345
Circular Linked with 3 Nodes
60. Operation on Linear linked lists
• Creating an empty list
• Traversing a list
• Searching an element
• Inserting an element
• Deleting an element
61. Header Linked List
• A header list is a linked list, which
always contains a special node, called
header node, at the beginning of the
linked list.
• This header node usually contains
vital information about the linked list
such as the number of nodes in the list,
whether the list is sorted or not.
63. Header Linked List
Types of header linked list:
• Header linear linked list
• Circular header list
• Two way header list
• Two way circular header list
68. Applications of linked lists
• To implement the other data structures
such as stacks, queues, trees and graphs.
• To maintain a directory of names.
• To perform arithmetic operation on long
integers.
• To manipulate polynomial.
• To represent sparse matrices.
69. Polynomial Manipulation
A polynomial of type
4x3
+6x2
+10x+6
can be represented using following linked
list
4 3 6 2 10 1 6 0 X
Poly coefficient
power
In the above list, each node has the following structure
Coefficient of the term Power of x Link to the next node
70. Polynomial Manipulation
The required memory declarations for the
representation of a polynomial with integer
coefficients are
typedef struct nodetype
{
int coeff;
int power;
struct nodetype *next;
}node;
node *poly;
71. Examples
a x x= + +3 2 114 8
b x x x= − +8 3 1014 10 6
3 14 2 8 1 0
a
null
8 14 -3 10 10 6
b
null
Polynomial Representation: Example
72. Adding Polynomials: Figure 4:19 c = a + b
4.6.2 Adding Polynomials: c = a + b
Case 1: p->exp = q->exp
3 14 2 8 1 0
p
8 14 -3 10 10 6
q
11 14
a
b
c
73. Adding Polynomials : c = a + b (cont.)
Case 2: p->exp < q->exp
3 14 2 8 1 0
p
8 14 -3 10 10 6
q
11 14 -3 10
a
b
c
74. 3 14 2 8 1 0
p
8 14 -3 10 10 6
q
11 14 -3 10 2 8
Case 3: p->exp > q->exp
Adding Polynomials: c = a + b (cont.)
75. Representing sparse matrices
• inadequate of sequential schemes
(1) # of nonzero terms will vary after some matrix computation
(2) matrix just represents intermediate results
• new scheme
• Each column (row): a circular linked list with a head node
0 0 0 2 0 0
0 0 1 0 0 5
0 4 0 0 0 0
0 0 0 0 0 0
0 0 0 0 7 0
A 5X6 sparse matrices
76. Sparse Matrix
The description of this representation is as
• It contains one header node that has four fields….
--#of rows
--#of cols
--#of non zero elements
--head i.e. pointer to 1st
row containing at least one non zero element.
• A linked list of rows containing at least one non zero term, in the ascending
order of their row values. each node of this list has three fields
--row (row number for corresponding row list)
--next (pointer to next node in the row list)
--first (a pointer to first column in a row having non zero item)
• A linked list of columns containing nonzero terms, in the ascending order of
their column values. Each node of this list has three fields
--col (column number for corresponding row list)
--term ( a non zero value in column col)
--link (a pointer to next column having non zero element)
77. Sparse Matrix
5 6 5
1 4 2 X
2 3 1
3 2 4 X
5 X 5 7 X
6 5 X
A linked representation of sparse matrix
78. Required memory declaration
Structure of column node:
typedef struct columnnodetype
{
int col;
float element;
struct columnnodetype *link;
}columnnode;
80. Required memory declaration
Structure of header node:
typedef struct headernodetype
{
int nrow;
int ncol;
int num;
struct rownode *head;
}headernode;
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94. Linked list Problems
1. Write a function that return value 1 if the
linear linked list is sorted in the ascending
order otherwise it returns value 0.
2. Write a function that makes copies of
given linear linked list.
3. Write a function that merge two sorted
linear linked list.
4. Write a function that sorts a linear linked
list of integer values in the descending
order.
95. Josephus Problem
It consists of a group of soldiers surrounded by a heavy
enemy force. There is only one horse to escape.
Therefore, only one soldier can escape. In order to
determine which soldier will escape, they form a circle
and pick up a number n from a hat. A name is also
picked up from the hat. They start counting clockwise
around the circle from a soldier whose name is picked up
from the hat. And the soldier on which count reaches n
is removed from the circle. And the count again starts
from the soldier who was next to the soldier who is
removed from the circle. This process goes on till only
one soldier is left. This soldier will take the horse and
escapes. Write a program to solve this problem. Input to
your program is list of names of soldiers and number n
and the output should be the name of the soldier left.