Skip to content
This repository has been archived by the owner on Oct 23, 2018. It is now read-only.

new(LaWea): hello world in lawea language #4728

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions AWK/hello_world.awk

This file was deleted.

5 changes: 0 additions & 5 deletions Bash/helloworld

This file was deleted.

2 changes: 0 additions & 2 deletions Bash/helloworld.sh

This file was deleted.

1 change: 0 additions & 1 deletion Brainfuck/HelloWorld.bf

This file was deleted.

12 changes: 0 additions & 12 deletions C#/HelloWorld.cs

This file was deleted.

52 changes: 26 additions & 26 deletions C++/BinarySearch.cpp
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
#include<iostream>
using namespace std;
bool BinarySearch(int arr[], int n, int k){
int s=0;int e=n-1;
while (s<=e){
int mid=(s+e)/2;
if (arr[mid]==k) return true;
if (arr[mid]<k){
s=mid+1;
} else {
e=mid-1;
}
}
return false;
}
int main(){
int n,target;
cout<<"Enter the size of the array"<<endl;
int arr[n];
cout<<<"Enter elements of the array"<<endl;
for (int i=0;i<n;i++) cin>>arr[i];
cout<<"enter the number you want to search";
cin>>target;
if(BinarySearch(arr,n,target) cout<<"The number exists"<<endl;
else cout<<"The number doesn't exists"<<endl;
#include<iostream>
using namespace std;
bool BinarySearch(int arr[], int n, int k){
int s=0;int e=n-1;
while (s<=e){
int mid=(s+e)/2;
if (arr[mid]==k) return true;
if (arr[mid]<k){
s=mid+1;
} else {
e=mid-1;
}
}
return false;
}

int main(){
int n,target;
cout<<"Enter the size of the array"<<endl;
int arr[n];
cout<<<"Enter elements of the array"<<endl;
for (int i=0;i<n;i++) cin>>arr[i];
cout<<"enter the number you want to search";
cin>>target;
if(BinarySearch(arr,n,target) cout<<"The number exists"<<endl;
else cout<<"The number doesn't exists"<<endl;
230 changes: 115 additions & 115 deletions C++/Circular Queue.cpp
Original file line number Diff line number Diff line change
@@ -1,115 +1,115 @@
#include <iostream>
#define SIZE 5 /* Size of Circular Queue */

using namespace std;

class Queue {
private:
int items[SIZE], front, rear;

public:
Queue(){
front = -1;
rear = -1;
}

bool isFull(){
if(front == 0 && rear == SIZE - 1){
return true;
}
if(front == rear + 1) {
return true;
}
return false;
}

bool isEmpty(){
if(front == -1) return true;
else return false;
}

void enQueue(int element){
if(isFull()){
cout << "Queue is full";
} else {
if(front == -1) front = 0;
rear = (rear + 1) % SIZE;
items[rear] = element;
cout << endl << "Inserted " << element << endl;
}
}

int deQueue(){
int element;
if(isEmpty()){
cout << "Queue is empty" << endl;
return(-1);
} else {
element = items[front];
if(front == rear){
front = -1;
rear = -1;
} /* Q has only one element, so we reset the queue after deleting it. */
else {
front=(front+1) % SIZE;
}
return(element);
}
}

void display()
{
/* Function to display status of Circular Queue */
int i;
if(isEmpty()) {
cout << endl << "Empty Queue" << endl;
}
else
{
cout << "Front -> " << front;
cout << endl << "Items -> ";
for(i=front; i!=rear;i=(i+1)%SIZE)
cout << items[i];
cout << items[i];
cout << endl << "Rear -> " << rear;
}
}

};


int main()
{
Queue q;

// Fails because front = -1
q.deQueue();

q.enQueue(1);
q.enQueue(2);
q.enQueue(3);
q.enQueue(4);
q.enQueue(5);

// Fails to enqueue because front == 0 && rear == SIZE - 1
q.enQueue(6);


q.display();

int elem = q.deQueue();

if( elem != -1)
cout << endl << "Deleted Element is " << elem;

q.display();

q.enQueue(7);

q.display();

// Fails to enqueue because front == rear + 1
q.enQueue(8);

return 0;
}
#include <iostream>
#define SIZE 5 /* Size of Circular Queue */
using namespace std;
class Queue {
private:
int items[SIZE], front, rear;
public:
Queue(){
front = -1;
rear = -1;
}
bool isFull(){
if(front == 0 && rear == SIZE - 1){
return true;
}
if(front == rear + 1) {
return true;
}
return false;
}
bool isEmpty(){
if(front == -1) return true;
else return false;
}
void enQueue(int element){
if(isFull()){
cout << "Queue is full";
} else {
if(front == -1) front = 0;
rear = (rear + 1) % SIZE;
items[rear] = element;
cout << endl << "Inserted " << element << endl;
}
}
int deQueue(){
int element;
if(isEmpty()){
cout << "Queue is empty" << endl;
return(-1);
} else {
element = items[front];
if(front == rear){
front = -1;
rear = -1;
} /* Q has only one element, so we reset the queue after deleting it. */
else {
front=(front+1) % SIZE;
}
return(element);
}
}
void display()
{
/* Function to display status of Circular Queue */
int i;
if(isEmpty()) {
cout << endl << "Empty Queue" << endl;
}
else
{
cout << "Front -> " << front;
cout << endl << "Items -> ";
for(i=front; i!=rear;i=(i+1)%SIZE)
cout << items[i];
cout << items[i];
cout << endl << "Rear -> " << rear;
}
}
};
int main()
{
Queue q;
// Fails because front = -1
q.deQueue();
q.enQueue(1);
q.enQueue(2);
q.enQueue(3);
q.enQueue(4);
q.enQueue(5);
// Fails to enqueue because front == 0 && rear == SIZE - 1
q.enQueue(6);
q.display();
int elem = q.deQueue();
if( elem != -1)
cout << endl << "Deleted Element is " << elem;
q.display();
q.enQueue(7);
q.display();
// Fails to enqueue because front == rear + 1
q.enQueue(8);
return 0;
}
8 changes: 0 additions & 8 deletions C++/Hello World

This file was deleted.

13 changes: 0 additions & 13 deletions C++/HelloWorld.cpp

This file was deleted.

32 changes: 0 additions & 32 deletions C++/Queue/Queue.h

This file was deleted.

26 changes: 0 additions & 26 deletions C++/binarysearch.cpp

This file was deleted.

Loading