1596071880

Learning all the ins and outs of JS can be overwhelming, but especially when one starts to tackle data structures. In this series I will try to break down some of the basics, easing all of our pain with pictures of dogs, starting with Singly Linked Lists.

In an array, elements are indexed based on their position.

One of the first data structures we learn to use as newbie coders is arrays. To recap, arrays are a list of items that are assigned an index, or a numeric value based on their place in the array. Think of an array like a staircase with a cute pupper sitting on each step. Each step has a value, and we can find each pupper by counting the step that they are on. The first pup is at the bottom, not quite a step yet so we give it the value or index of 0, the next pupper is on the first step so it is at the index of 1.

**Linked lists** are a little bit different. Instead of every pup (or node, instead of element) having an index, each node is just pointing to the next node. Think of it like a train, each car is connected to the next car, which is connected to the next car, and so forth. In an array we can say “Give me the sixth pup,” but in a linked list we have to start at the beginning of the train, and go from the first car, to the second car, and so forth.

In a linked list, each node is connected to the next, like a train!

#data-structures #javascript #women-who-code #web-development #programming

1620466520

If you accumulate data on which you base your decision-making as an organization, you should probably think about your data architecture and possible best practices.

If you accumulate data on which you base your decision-making as an organization, you most probably need to think about your data architecture and consider possible best practices. Gaining a competitive edge, remaining customer-centric to the greatest extent possible, and streamlining processes to get on-the-button outcomes can all be traced back to an organization’s capacity to build a future-ready data architecture.

In what follows, we offer a short overview of the overarching capabilities of data architecture. These include user-centricity, elasticity, robustness, and the capacity to ensure the seamless flow of data at all times. Added to these are automation enablement, plus security and data governance considerations. These points from our checklist for what we perceive to be an anticipatory analytics ecosystem.

#big data #data science #big data analytics #data analysis #data architecture #data transformation #data platform #data strategy #cloud data platform #data acquisition

1622127960

In computer science, we refer to the format of storing data on storage devices as a data structure. An array is the collection of data stored in contiguous memory locations.

This makes accessibility very easy but it leads to not so efficient use of memory because the smaller chunks of memory that are left between earlier stored data are not used.

But what if you need more efficient utilization of your memory. Here dynamic data structures come into the picture. Dynamic data structures as the name suggest do not have a fixed memory size.

They can shrink or grow themselves by deallocating or allocating the memory respectively, as and when required.

In this article, we will learn about the most basic dynamic data structures, Linked list, their types, and how to do basic operations on a linked list.

A linked list is the most basic type of dynamic data structure. A linked list is a linear collection of data where the order of elements is not given by their physical memory address. The user stores the data in blocks of memory called nodes.

Each node has two parts. The first part contains the data and the second part points towards the next node. It contains the address of the next node in the actual memory.

Singly-linked lists are the most basic and easy to implement linked lists. Each node stores the data at random memory locations and contains a pointer that points to the next node in the memory.

Each node contains data and two pointers. One point to the previous node and the other points to the next node. This makes doubly-linked traversable both forward and backward.

Just like a singly linked list, here also each node is linked to the next only with a slight modification. In a circular linked list, the last node of the list is pointed to the first node forming a loop. So we can reach the previous node by traversing forward.

In this article, we will be learning about Singly-linked lists only. We will learn about other types in detail in future articles.

A singly linked list as we have seen contains multiple nodes in which the earlier node points at the next node except the last node. A node has two parts, the first one contains the data and the second part contains the address of the next node.

C program for creating a Linked List Node:

struct node { int data; // data to store in node struct node *next; //NULL for last node }

*The previous part of the first node and the next part of the last node will always have NUL*

Unlike arrays, in a linked list, memory allocation takes place at runtime and therefore memory location of each node is random. Each node can be present anywhere in the memory and to access them, each node has the address of its next node stored with it.

This forms a kind of link between every node. This is the additional pointer that we need because if the link is not present or it’s broken, the memory locations will be lost.

**Insert:**Insert the node at any position. Worst-case time complexity O(1).**Delete:**Delete the node at any position. Worst-case time complexity O(1).- **Search: **Search for a specific node in the list. The worst-case time complexity O(n).
**Display:**Display a complete list. The worst-case time complexity O(n).

Adding nodes in a linked list can be sometimes tricky. Since a linked list is a dynamic data structure, we can not just break a link and add or delete the node anywhere. To better understand this let us do a thought experiment.

Consider a linked list similar to a train with multiple coaches. Each coach represents the first part of the node where data is present, here passengers. The next part of the coach, i.e. the coupling represents the second part of the node. This part contains a connection to the next node.

Now, if you want to add a new coach to a moving train you cannot simply uncouple any two coaches and add a new coach. As soon as you uncouple the coaches, the second part of the train which is not attached to the engine will be left behind and that will fail the task.

Similarly, in the linked list, we cannot just break a link between any two nodes and add a new node. Suppose you want to add a new node between the fourth and fifth nodes. To do that you first have to traverse from the first node to the fifth node.

Point the new node to the fifth node and then traverse again from the start to the fourth node. Point the fourth node towards the new node. The new node is now a part of the linked list.

#data structure tutorials #data structures #delete node in linked list #linked list

1621103940

Continuing on the Quick Revision of Important Questions for My Interviews. These Are Good Puzzles or Questions Related to Data Structures.

*My Article Series on Algorithms and Data Structures in a Sort of ‘Programming Language Agnostic Way’. Few of the Algorithms and Data Structures in C, Few in C++, and Others in Core Java. Assorted Collection for Learning, Revising, Revisiting, Quick Refresh, and a Quick Glance for Interviews. You May Even Include them Directly for Professional or Open Source Efforts. Have Included Explanation Only for Few of These! Hope these turn out to be Really Helpful as per the Author’s Intention.*

#java #core java #data structures #dijkstra #core java basics #data structure using java #algorithms and data structures #java code examples #linked list in java #circular linked list

1620629020

The opportunities big data offers also come with very real challenges that many organizations are facing today. Often, it’s finding the most cost-effective, scalable way to store and process boundless volumes of data in multiple formats that come from a growing number of sources. Then organizations need the analytical capabilities and flexibility to turn this data into insights that can meet their specific business objectives.

This Refcard dives into how a data lake helps tackle these challenges at both ends — from its enhanced architecture that’s designed for efficient data ingestion, storage, and management to its advanced analytics functionality and performance flexibility. You’ll also explore key benefits and common use cases.

As technology continues to evolve with new data sources, such as IoT sensors and social media churning out large volumes of data, there has never been a better time to discuss the possibilities and challenges of managing such data for varying analytical insights. In this Refcard, we dig deep into how data lakes solve the problem of storing and processing enormous amounts of data. While doing so, we also explore the benefits of data lakes, their use cases, and how they differ from data warehouses (DWHs).

*This is a preview of the Getting Started With Data Lakes Refcard. To read the entire Refcard, please download the PDF from the link above.*

#big data #data analytics #data analysis #business analytics #data warehouse #data storage #data lake #data lake architecture #data lake governance #data lake management

1604028420

In the previous “Data Structures in JavaScript” discussion, we walked through the methodology used to construct a node class which represent each “link” in the “chain” that is a linked list. From there we discussed how to construct a singly linked list from a an array. Building on the previous discussion, we will now dive into editing that singly linked list. If you are not familiar with the code and terminology covered in the previous article it is recommended you review Building a Singly Linked List.

With a linked list there are three ways to edit the list: update a nodes data property, add a node to the list or delete a node from the list. In all these cases, we will want to access a specific place in the singly linked list. Depending on the situation, you might want to edit the nth node from the head of the list, the nth node from the end of the list, or a node of a particular data value. For this discussion, we will assume that we are interested in editing the nth Node from the head of the list. With this in mind, we can step through a singly linked list from the head to the nth a node using a simple for loop as shown in Figure 1.

#javascript #singly-linked-list #linked-lists #data-structures #algorithms