DEV Community

Cover image for CS Series πŸ‘©β€πŸš€ #4 : Intro to Data Structures and Algorithms
Abdulrahman
Abdulrahman

Posted on

3

CS Series πŸ‘©β€πŸš€ #4 : Intro to Data Structures and Algorithms

04 - Intro to Data Structure and Algorithms

image

  • An algorithm is every function you created in Golang or any other programming language you programmed in. Any steps (programming statements) you wrote to solve a problem. And all programming problems is about processing data. So, in Computer Science there is field of Algorithms. which focuses on dealing with processing data at scale, and analyzing the performance of an algorithm to solve programming problems such as sorting, searching, removing and so on.

05

  • So before we talk about Algorithms, let's talk about a data that a program might have
  • First of all any data in a program has a type. A data type help us define 2 things
    • a domain of allowed values
    • a set of operations on these values
  • And a program compiler will through a compilation error if we misuse a data type, for example performing multiplication on chars
    • z = x*y is not allowed
    • true/false is not allowed

06

Atomic / Simple Data

  • Have no component parts. E.g int, char , float, etc

Data Structur

  • types that can be broken into parts. for example a Person object consist of two properties : name and an age, both of them are atomic data types (string, int respectively )
    • object β‡’ broken into properties
    • array β‡’ broken into indeces
  • So a data structure is a data type whose values
    • can be decomposed into a set of atomic data or another data structure (2D Array)
    • include a structure involving the component parts (a fixed technique on how to search, store, remove and so on)
    • Possible Structures: Set, Linear, Tree, Graph

Abstract Data Types (ADTs)

  • Provide a level of Abstraction : I want to use a data structure but I don't want to know how it's implemented, for example in Golang you can append to a slice but you don't care of the implementation at the time of using the slice data structure

How to create your own data structure

While designing ADTs, a designer has to deal with two types of questions:

  • What values are in the domain? What operations can be performed on the values of a particular data type?
  • How is the data type represented?
  • How are the operations implemented?

Jetbrains image

Is Your CI/CD Server a Prime Target for Attack?

57% of organizations have suffered from a security incident related to DevOps toolchain exposures. It makes senseβ€”CI/CD servers have access to source code, a highly valuable asset. Is yours secure? Check out nine practical tips to protect your CI/CD.

Learn more

Top comments (0)

Jetbrains image

Build Secure, Ship Fast

Discover best practices to secure CI/CD without slowing down your pipeline.

Read more

πŸ‘‹ Kindness is contagious

Engage with a wealth of insights in this thoughtful article, cherished by the supportive DEV Community. Coders of every background are encouraged to bring their perspectives and bolster our collective wisdom.

A sincere β€œthank you” often brightens someone’s dayβ€”share yours in the comments below!

On DEV, the act of sharing knowledge eases our journey and forges stronger community ties. Found value in this? A quick thank-you to the author can make a world of difference.

Okay