Skip to content

A repository containing code for Lab 2 of my DSA course at NUST

License

Notifications You must be signed in to change notification settings

LylaB/DSA-Lab2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DSA-Lab

This repository contains the implementation and solutions for Labs of my Data Structures and Algorithms (DSA) course at NUST.

Contents

Lab2

  • hello.cpp:
    • Purpose: Prints a welcome message to the console.
    • Input/Output: Outputs "Welcome to DSA Lab 2!" to the terminal.
  • salary.cpp:
    • Purpose: Manages employee salary data with dynamic memory allocation.
    • Input/Output: Takes 20 employee salaries as input and outputs updated salaries after applying an increment formula.
  • string_reverse.cpp:
    • Purpose: Reverses a user-provided string using dynamic memory allocation.
    • Input/Output: Accepts a string from user input and displays the reversed version of that string.
  • analyze_pointer.cpp:
    • Purpose: Demonstrates pointer operations and memory analysis.
    • Input/Output: Creates pointers and displays their addresses and values they point to.

Lab3

  • LinkedList.cpp:
    • Purpose: Implements a singly linked list with various insertion, deletion, and traversal operations.
    • Input/Output: Takes user input for operations (insert/delete/display) and outputs the current state of the list or operation results.
  • queue.cpp:
    • Purpose: Implements a queue data structure using linked nodes with enqueue, dequeue, and peek operations.
    • Input/Output: Accepts values to enqueue and performs queue operations, displaying the queue contents and operation results.
  • CircularLinkedList.cpp:
    • Purpose: Implements a circular linked list with operations for insertion, deletion, and traversal in a circular structure.
    • Input/Output: Takes values for insertion/deletion operations and displays the circular list structure and operation outcomes.

How to Run

  1. Clone this repository:
    git clone https://github.com/ShahzaibAhmad05/DSA-Lab2.git
    

Contributions are welcome!

You can:

  • Add helpful comments in code files.
  • Suggest more efficient algorithms.
  • Fix spelling/grammar in code or documentation.

About

A repository containing code for Lab 2 of my DSA course at NUST

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%