Monday 23 October 2017

Parser for Sample Language

Creation of Parser for a Sample Language using Lex &Yacc.


Basic Version for Parsing simple c++ code

Saturday 21 October 2017

Concurrent Quick Sort Class in OpenMP

Q: Design a class for concurrent quicksort in C++.

Decided to use OpenMp since Pthread doesn't work well with classes, not without ton's of efforts.

Friday 20 October 2017

Recursive & Iterative Binary Search in Scala

Scala

My very first program in Scala. And I don't find Scala close to Java. I am quite used to Java and C++ and rather find the two more close as very as programming is concerned.

Scala however is closer to Java since scala code is converted to Java Bytecode and the executed.

Program

I used 2 classes a Binary Search class & a Tester object
. An object is more like a singleton class according to my understanding. 
The BinarySearch class has constructor which accepts a sorted array.
It has 2 functions 
  1. A Recursive Binary Search
  2. An Iterative Binary Search.