Posts

Showing posts with the label array

Data Structures and Algorithms - Arrays (2)

Image
Array is a container which can hold a fix number of items and these items should be of the same type. Most of the data structures make use of arrays to implement their algorithms. Following are the important terms to understand the concept of Array. Element  − Each item stored in an array is called an element. Index  − Each location of an element in an array has a numerical index, which is used to identify the element. Array Representation Arrays can be declared in various ways in different languages. For illustration, let's take C array declaration. Arrays can be declared in various ways in different languages. For illustration, let's take C array declaration. As per the above illustration, following are the important points to be considered. Index starts with 0. Array length is 10 which means it can store 10 elements. Each element can be accessed via its index. For example, we can fetch an element at index 6 as 9. Basic Operations Following are the basic operations supported

Data Structures & Algorithms - Quick Guide (Step By Step) (1)

Image
  Overview Data Structure is a systematic way to organize data in order to use it efficiently. Following terms are the foundation terms of a data structure. Interface  − Each data structure has an interface. Interface represents the set of operations that a data structure supports. An interface only provides the list of supported operations, type of parameters they can accept and return type of these operations. Implementation  − Implementation provides the internal representation of a data structure. Implementation also provides the definition of the algorithms used in the operations of the data structure. Characteristics of a Data Structure Correctness  − Data structure implementation should implement its interface correctly. Time Complexity  − Running time or the execution time of operations of data structure must be as small as possible. Space Complexity  − Memory usage of a data structure operation should be as little as possible. Need for Data Structure As applications are gettin

Transpose of Array| Numpy tutorial | Data Science | Codin India

Image
  In the last post, we learned about reshaping the Numpy array. In this post, we will learn about the transpose of nd-array. Another very interesting reshaping method of Numpy is the   Transpose()   method.   Transpose is an very important topic when we talk about matrices and arrays. In linear algebra, the transpose of a matrix is an operator which flips a matrix over its diagonal. i.e.  It takes the input Array and swaps the rows and columns value and vica-versa. After transpose rows becomes columns and columns becomes rows.  Let us understand by code:-   Output:- It will convert rows into columns and columns to rows. I hope you will Like this post :) if you want to learn python then this tutorial will help you alot Python tutorial for beginners in hindi Please Subscribe to our Youtube Channel - Codin India

Data Structure using Python| codin india

Image
  Data Structure   is a particular way of organizing data in a Computer, so that it can be used effectively. For Example:-   We can store a list of items having the same data-type using arrays. Data structures are fundamental concepts of computer science which helps is writing efficient programs in any language. Python is a high-level, interpreted, interactive and object-oriented scripting language using which we can study the fundamentals of data structure in a simpler way as compared to other programming languages. Types of Data Structure Data structures in computer science are divided into two categories. We will discuss about each of the below data structures in detail one by one. In today's post we will only discuss about data structure definition and its types. We will learn and implement its various types one by one with example. Data Structure Linear Data Structure Non-Linear Data Structure Linear Data Structure A Linear data structure have data elements arranged in sequent