Skip to content

ajmanjoma/Data-Structure-Labs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

DS LAB: Data Structures Laboratory

Welcome to the DS Lab, where we explore the world of data structures and their applications. Data structures provide a way to organize and store related variables in a structured manner. In this lab, we will dive into different data structures and understand how they can be used effectively.

Structures in Programming

Structures, also known as structs, allow us to group multiple related variables into a single unit. Each variable within a structure is referred to as a member. By organizing variables in this way, we can create more organized and modular code structures.

Linux C Programming

Linux is a developer's paradise, offering an open-source operating system with free programming tools for various programming languages. In this article, we will guide you through writing, compiling, and running a simple C program on Ubuntu Linux. This foundational knowledge will serve as a stepping stone for more complex and useful C programs that you can develop and run on Linux.

While we have tested the steps and commands on an Ubuntu 22.04 LTS system, they should work the same on other versions such as Ubuntu 20.04 or Debian 11.

To compile C programs on Linux, we will utilize the command-line tool called the terminal. You can open the terminal by using the Ubuntu Dash or pressing the key combination Ctrl+Alt+T.

Step 1: Install the Build-Essential Packages

Before you can compile and execute a C program, you need to ensure that the essential packages are installed on your system. To do this, enter the following command in your Linux Terminal as the root user:

$ sudo apt-get install build-essential

Step 2: Write a Simple C Program

Now that you have the necessary packages installed, it's time to write your first C program. Use a text editor of your choice to create a new file and write your C code.

Step 3: Compile the C Program with the GCC Compiler

To compile your C program, use the GCC (GNU Compiler Collection) compiler. In the Terminal, enter the following command to generate an executable version of your program:

Syntax:

$ gcc [programName].c -o programName

Step 4: Run the Program

Once your C program is compiled successfully, you can proceed to run it. Use the following syntax to execute the compiled C program:

$ ./programName

Replace programName with the name you provided during compilation.

By following these steps, you can write, compile, and run C programs on Linux. This knowledge will lay the foundation for exploring more complex algorithms and data structures in the DS Lab.

Feel free to experiment with different C programs, explore various data structures, and enhance your programming skills. Happy coding in the DS Lab!

About

Structures (also called structs) are a way to group several related variables into one place. Each variable in the structure is known as a member of the structure.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages