Skip to content

SeyranGit/collection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository is a collection of mini-programs

  • List Data Structure
  • Stack Data Structure
  • Full Adder
  • Floating Point Arithmetic

  _       _    ____    _____  
 | |     | |  | ___|  |_   _| 
 | |     | |  |___ \    | |   
 | |__   | |   ___) |   | |   
 |_|__|  |_|  |____/    |_|   

Usage example

#include <stdio.h>
#include "list/list.h"

int main(void) {
  List numbers = new_list(); 
  numbers.append(&numbers, 10);
  numbers.append(&numbers, 20);
  numbers.append(&numbers, 30);

  print_list(&numbers);
  numbers.remove(&numbers, 1);
  print_list(&numbers);
  numbers.insert(&numbers, 0, 22);
  print_list(&numbers);
  printf("Item: %d\n", numbers.get(&numbers, 1));
  clear_list(&numbers);

  return 0;
}

Output

[10, 20, 30]
[10, 30]
[22, 10, 30]
Item: 10

Build

If you don't have LLVM installed, you need to install it from the following link: LLVM. You may need to add the path to "../LLVM/bin" to your environment variable. Once installed, you can clone the repositories and enter the following command in the terminal if you are using Windows:

build